Christoph Jopp wrote:
> Jonathan Kaye schrieb:
>> Jonathan Kaye wrote:
>>
>> <snip>
>>
>>> Hi Fernand,
>>> Thanks for the reference. I had a look but there's a huge amount of
>>> material and I didn't really see anything relevant to the situation I
>>> described. Can you give me a hint as to how to define a substring of an
>>> object that is itself an object and so can be formatted like an object.
>>>
>>> Sorry to be thick but I couldn't really see anything in GetTexts that
>>> deals with this.
>>>
>>> Thanks again,
>>> Jonathan
>>>
>> As a follow-up to my previous message, I can see that
>> oCell=oSheet.getCellByposition(0,0) 'A1
>> and then
>> oCell.CharWeight = com.sun.star.awt.FontWeight.BOLD
>> should make the contents of oCell bold. What I don't understand is how to
>> make a substring of oCell
>> Position = InStr(oCell.getString(), ".")
>> Mid(oCell.getString(), 1, Position - 1)
>> bold. I just want the substring starting from position 1 and stopping
>> before a fullstop. That's what I want bold but I don't know how to refer
>> to that substring so I can give it a CharWeight attribute.
>>
>> I hope this is clearer.
>> Jonathan
>>
> Hi Jonathan,
>
> inside a Cell you can handle the Text as any Text f.e. in Writer.
> So you have to create a TextCursor:
> oTextCursor = oCell.createTextCursor()
> oTextCursor.gotoStart(false)
> oTextCursor.goRight(Position - 1, true)
> oTextCursor.setPropertyValue("CharWeight", 150)
> This should do what you want.
> To find out about the right PropertyValues and a lot more I suggest to
> use Bernard Marcelly's outstanding X-Ray-Tool you can get via this link
> http://ooomacros.org/dev.php#101416 (if you don't have it already ;-) ).
>
> Hope this helps
> Christoph
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(), ".")
oTextCursor = oCell.createTextCursor()
oTextCursor.gotoStart(false)
oTextCursor.goRight(Position - 1, true)
oTextCursor.setPropertyValue("CharWeight", 150)
End Sub
The result was a Basic syntax error at the line:
oTextCursor = oCell.createTextCursor()
I added the Dim statement declaring oTextCursor as an object but still get
the syntax error.
Any ideas?
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]