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

Remove Page-breaks from writer document using Java UNO

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


Joined: 28 Oct 2010
Posts: 10

PostPosted: Mon Jan 10, 2011 2:56 am    Post subject: Remove Page-breaks from writer document using Java UNO Reply with quote

Hello there,
I am using OOo UNO API 3.2 for Java on Windows. I am replacing various bookmarks in the template document with contents from other document using insertDocumentFromURL().
Everytime, I am replacing a bookmark using insertDocumentFromURL(), its adding page break.

I am not able to find out why page-breaks are getting added. I searched this forum and found following thread (does not have solution thogh)

[url] http://www.oooforum.org/forum/viewtopic.phtml?t=28376 [/url]

Any pointers on removing unwanted page breaks would be of great help.

Thanks
Sumukh
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


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

PostPosted: Mon Jan 10, 2011 9:31 am    Post subject: Reply with quote

Don't do Java any more but try this Basic code to remove page breaks.
Code:
Sub Main
oDoc = ThisComponent
oTC = oDoc.Text.createTextCursor
oTC.gotoStart(false)
Do
If oTC.BreakType <> 0 then oTC.BreakType = 0
Loop While oTC.gotoNextParaGraph(false)
End Sub
Back to top
View user's profile Send private message
sumukh17
General User
General User


Joined: 28 Oct 2010
Posts: 10

PostPosted: Tue Jan 11, 2011 11:31 pm    Post subject: Reply with quote

Its actually a section break..Anybody already have the solution to remove section breaks using Java OO API ?
Thanks John for the snippet. I will try to port it to Java.

Thanks
Sumukh
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