Jonathan Kaye wrote:
Hi all,

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
I have no expirience with Calc but i supose you need a "viewcursor" to move around in a sheet and then place your text at the different positions
order. There is a macro that does exactly what I want but only works in text
docs and not spreadsheets:
Code:
Sub InsertSimpleText
Dim oDoc As Object
Dim oText As Object
Dim oVCurs As Object
Dim oTCurs As Object
oDoc = ThisComponent
oText = oDoc.Text
oVCurs = oDoc.CurrentController.getViewCursor()
oTCurs = oText.createTextCursorByRange(oVCurs.getStart())
' Place the text to insert here
oText.insertString(oTCurs, "—", FALSE)
End Sub

I really did try and 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. Is there a reference manual for OOo Basic that includes all the
built-in properties, methods, functions, subroutines, etc. containing stuff
I uses the Xray tool from Bernand Marcely. who gives me a answer on 99% of all my quenstions :-)




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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to