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


Joined: 28 Oct 2010 Posts: 10
|
Posted: Mon Jan 10, 2011 2:56 am Post subject: Remove Page-breaks from writer document using Java UNO |
|
|
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 |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8979 Location: Lexinton, Kentucky, USA
|
Posted: Mon Jan 10, 2011 9:31 am Post subject: |
|
|
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 |
|
 |
sumukh17 General User


Joined: 28 Oct 2010 Posts: 10
|
Posted: Tue Jan 11, 2011 11:31 pm Post subject: |
|
|
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 |
|
 |
|