| View previous topic :: View next topic |
| Author |
Message |
zizi General User

Joined: 04 May 2012 Posts: 14
|
Posted: Sun May 06, 2012 5:58 am Post subject: Solve: insert String(NewBie) |
|
|
Hi,
I am using insert String to insert sentences into the presentation slide. If I need to insert a paragraph, do I still use insertString. It has the left, right and center justification but it doesn't have the "justified" option. This left me wondering if perhaps another option should be used to insert a paragraph.
Many Thanks,
zizi
Last edited by zizi on Thu May 10, 2012 3:01 am; edited 1 time in total |
|
| Back to top |
|
 |
patel Power User

Joined: 14 Apr 2012 Posts: 54 Location: Italy
|
Posted: Sun May 06, 2012 7:01 am Post subject: |
|
|
http://www.pitonyak.org/oo.php _________________ If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button). |
|
| Back to top |
|
 |
DVezina OOo Advocate

Joined: 29 Sep 2006 Posts: 248 Location: Orlando
|
Posted: Sun May 06, 2012 10:48 am Post subject: |
|
|
If you haven't already installed xray, I would do that because its the easiest way to see the methods, properties and services allowed for each object. See first sticky post in this forum.
After that, the AndrewMacro document if very helpful. It is written primarily for Word but you can use a lot of it for Impress.
For your immediate problem:
ParaAdjust property on the textcursor controls text alignment.
0 = left
1 = right
2 = justified
3 = center
| Code: | Set body=Slide.getbyindex(1)'the first shape is the body
Set BodyText=body.getText()'this bit is like talking to writer
Set Cursor=BodyText.createTextCursor()
Cursor.ParaAdjust=2
Cursor.ParaIsHyphenation=True
Call BodyText.insertString(Cursor,"Outline Item 1 Now is the time for all good men to come to the aid of their father land in this time of dire need. Now is the time.",False)
Cursor.GoToEnd(False)
Call BodyText.insertString(Cursor,Chr(10),False)
Cursor.ParaAdjust=3
Cursor.ParaIsHyphenation=False
Call BodyText.insertString(Cursor,"Outline Item 1 Now is the time for all good men to come to the aid of their father land in this time of dire need. Now is the time.",False) |
|
|
| Back to top |
|
 |
zizi General User

Joined: 04 May 2012 Posts: 14
|
Posted: Thu May 10, 2012 3:02 am Post subject: |
|
|
| Many thanks! |
|
| Back to top |
|
 |
|