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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]