Joined: 07 Feb 2008
Location: Girona, Espanya
|Posted: Thu Feb 07, 2008 5:16 am Post subject: inserting at cursor in Calc macro
I'm a newbie at Openoffice Basic macrolanguage but an oldbie at writing macros.
I am making slow progress on understanding the ins and outs of OOo Basic. I have written the following macro which seems to work:
' Appends the character œ at the end of selected cell
Dim oDoc As Object
Dim oCell As Object
Dim oSheet As Object
Dim here As Object
oDoc = ThisComponent
here.setString(here.getString() & "œ")
This is almost what I want but is there a trivial change that I can make so
that œ is inserted at the current cursor position when one is adding data
to a cell? I searched every where in Andrews (online version) book and
couldn't find any reference to CursorPos or CurPos or something of that
order. I tried replacing
|here.setString(here.getString() & "œ") |
|here.setString(here.getStart() & "œ") |
but that seems to be only for Writer documents not calc.I am not trying to avoid doing the grunt work but I really did tryand couldn't any reference to specifying the current cursor position. I'm sure it's in there somewhere but I can't guess what it's called. And is there an thorough catalog of things like GetString, GetValue, GetStart that I could search and not have to bother this forum with my questions.
TIA for any help you can provide.