| View previous topic :: View next topic |
| Author |
Message |
dominikform Newbie

Joined: 10 Sep 2008 Posts: 2
|
Posted: Wed Sep 10, 2008 10:45 pm Post subject: Formating cell in Calc thru API |
|
|
Hi,
I cannot solve one think in BASIC. I need write to cell string (ex. abcdefgh). Where part is in bold. But I do not know how to do it. Can you help me?
Thank you!
Dominik |
|
| Back to top |
|
 |
vitcaro OOo Advocate


Joined: 20 Feb 2007 Posts: 256 Location: Italy
|
Posted: Thu Sep 11, 2008 12:35 am Post subject: |
|
|
Here is an example of code:
| Code: |
Set oDoc = ThisComponent
Set oSheets = oDoc.getSheets
Set oSheet = oSheets.getByIndex(0)
Set oCell = oSheet.getCellByPosition(0, 0)
oCell.setString ("abc")
Set oText = oCell.GetText
Set TextCursor = oText.createTextCursor
TextCursor.gotoEnd False
TextCursor.CharHeight = 12
TextCursor.CharWeight = 150' FontWeight_BOLD
TextCursor.setString "def"
|
|
|
| Back to top |
|
 |
dominikform Newbie

Joined: 10 Sep 2008 Posts: 2
|
Posted: Thu Sep 11, 2008 1:35 am Post subject: |
|
|
| vitcaro wrote: | Here is an example of code:
| Code: |
Set oDoc = ThisComponent
Set oSheets = oDoc.getSheets
Set oSheet = oSheets.getByIndex(0)
Set oCell = oSheet.getCellByPosition(0, 0)
oCell.setString ("abc")
Set oText = oCell.GetText
Set TextCursor = oText.createTextCursor
TextCursor.gotoEnd False
TextCursor.CharHeight = 12
TextCursor.CharWeight = 150' FontWeight_BOLD
TextCursor.setString "def"
|
|
Aha!!! This is genial!!! Thanks!! |
|
| Back to top |
|
 |
|