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

CR in script

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
gijsbrechtvanaemstel
Newbie
Newbie


Joined: 31 Aug 2009
Posts: 3

PostPosted: Mon Aug 31, 2009 6:38 am    Post subject: CR in script Reply with quote

Hi, I'm using Java to create a generated OpenOffice form. Every form needs to begin on a new page in OpenOffice, so I was wondering if there's a way to define a Carriage Return in Script?
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Mon Aug 31, 2009 9:01 am    Post subject: Reply with quote

A carriage return is called a paragraph break in OOo. Sure you don't want a page break? Here are both in Basic - can't help with Java.
Code:
Sub PageBreak
oDoc = ThisComponent
oVC = oDoc.CurrentController.getViewCursor
REM oDoc.Text.insertControlCharacter(oVC,ControlCharacter_PARAGRAPH_BREAK,false) 'Carriage return
REM oVC.BreakType = 4 'Page break before the current paragraph.
REM oVC.BreakType = 5 'Page break after the current paragraph.
End Sub
Back to top
View user's profile Send private message
gijsbrechtvanaemstel
Newbie
Newbie


Joined: 31 Aug 2009
Posts: 3

PostPosted: Mon Aug 31, 2009 2:13 pm    Post subject: Reply with quote

Yes I think a page break is better, but I'm using JOOScript instead of Basic. Is there a way to fix a page break in JOOScript and to check if it's the first page of the document (because a break isn't needed on the first page)
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Tue Sep 01, 2009 5:08 am    Post subject: Reply with quote

Quote:
but I'm using JOOScript instead of Basic.
Can't help you there either but in my code above
Print oVC.getPage
will reveal the page number.
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 Writer 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