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

Text in Impress slide

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


Joined: 29 Nov 2011
Posts: 3
Location: United Kingdom

PostPosted: Tue Nov 29, 2011 1:49 am    Post subject: Text in Impress slide Reply with quote

Hi all,

I'm using pyuno to connect to an impress document and want to insert text into that document. I've managed to get my head around most things in the API but can't seem to piece together what is needed to place text into a presentation slide. Here is what I have so far...

Code:

all_pages = self.document.getDrawPages()
page = all_pages.insertNewByIndex(all_pages.getCount() + 1)

object_shape = self.document.createInstance('com.sun.star.drawing.RectangleShape')
object_shape.setSize(Size(10000, 5000))
object_shape.setPosition(Point(500, 500))
object_shape.FillStyle = fillstyle_none
text = object_shape.Text
text.CharColor = 25516616
text.CharHeight = 24
text.setString('Some text in here')
       
page.add(object_shape)


The text isn't showing at all but I can't figure out what I'm not doing?

Can anyone offer me any pointers on this?
_________________
- Tom
Back to top
View user's profile Send private message
cootetom
Newbie
Newbie


Joined: 29 Nov 2011
Posts: 3
Location: United Kingdom

PostPosted: Tue Nov 29, 2011 6:09 am    Post subject: Reply with quote

I've figured this out now from the docs.

Code:

object_shape = self.document.createInstance('com.sun.star.drawing.TextShape')
object_shape.setSize(Size(26000, 4000))
object_shape.setPosition(Point(1000, 5000))
page.add(object_shape)
       
object_shape.TextHorizontalAdjust = uno.getConstantByName('com.sun.star.drawing.TextHorizontalAdjust.LEFT')
object_shape.TextVerticalAdjust = uno.getConstantByName('com.sun.star.drawing.TextVerticalAdjust.TOP')
object_shape.setString('CoMPASS Analysis')
object_shape.CharColor = self._rgb_color(255, 166, 16)
object_shape.CharHeight = 48

_________________
- Tom
Back to top
View user's profile Send private message
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