OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

inserting at cursor in Calc macro

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
jdkaye
Newbie
Newbie


Joined: 07 Feb 2008
Posts: 1
Location: Girona, Espanya

PostPosted: Thu Feb 07, 2008 5:16 am    Post subject: inserting at cursor in Calc macro Reply with quote

Hi all,
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:
Code:

Sub oe
' 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
oSheet=oDoc.Sheets.getByName("Sheet1")
here=ThisComponent.CurrentSelection
here.setString(here.getString() & "œ")
End Sub

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
Code:
here.setString(here.getString() & "œ")
with
Code:
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.
Jonathan
_________________
Jonathan Kaye
jabber: jdkaye@amessage.at
sip:611049@fwd.pulver.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group