OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Formating cell in Calc thru API

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
dominikform
Newbie
Newbie


Joined: 10 Sep 2008
Posts: 2

PostPosted: Wed Sep 10, 2008 10:45 pm    Post subject: Formating cell in Calc thru API Reply with quote

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
View user's profile Send private message Visit poster's website
vitcaro
OOo Advocate
OOo Advocate


Joined: 20 Feb 2007
Posts: 256
Location: Italy

PostPosted: Thu Sep 11, 2008 12:35 am    Post subject: Reply with quote

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
View user's profile Send private message
dominikform
Newbie
Newbie


Joined: 10 Sep 2008
Posts: 2

PostPosted: Thu Sep 11, 2008 1:35 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group