Christoph Jopp wrote:
> Hi Jonathan
>
> Jonathan Kaye schrieb:
>> Hi Christoph,
>> I tried this:
>> Sub SetBold
>> Dim oDoc As Object, oSheet As Object, oCell As Object
>> Dim oTextCursor as Object
>> Dim Position as Integer
>> oDoc=ThisComponent
>> oSheet=oDoc.Sheets.getByName("Sheet1")
>> oCell=oSheet.getCellByposition(0,0) 'A1
>
>> Position = InStr(oCell.getValue(), ".")
Sorry, this was my mistake. I corrected the line to
...oCell.getString()
> In your original post this was:
> Position = InStr(oCell.getString(), ".")
> and that works for me.
> I'm assuming you try to execute this macro with content other than
> string in cell A1 now???
No, as I said above. My error. I corrected it and I still get the same
syntax error. I have a spreadsheet open and with cell A1 containing abc.def
Just to be very clear. My subroutine now looks like this:
Sub SetBold
Dim oDoc As Object, oSheet As Object, oCell As Object
Dim CellCont as string, oTextCursor as Object
Dim Position as Integer
oDoc=ThisComponent
oSheet=oDoc.Sheets.getByName("Sheet1")
oCell=oSheet.getCellByposition(0,0) 'A1
Position = InStr(oCell.getString(), ".")
oTextCursor = oCell.createTextCursor()
oTextCursor.gotoStart(false)
oTextCursor.goRight(Position - 1, true)
oTextCursor.setPropertyValue("CharWeight", 150)
End Sub
I get a syntax error at the oTextCursor = oCell.createTextCursor()
For you the same code functions? If so how exactly do you call the
subroutine? From the "Run" button in the Basic window?
Jonathan
--
Registerd Linux user #445917 at http://counter.li.org/
Please do not send me copies of list mail. I read the lists. Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]