Two ways how to insert Page Break:
- by UNO command:
.uno:InsertPagebreak
→ for my 2nd example uno(oDoc, "InsertPagebreak")
And it sets Page Break to the position of visible cursor (represented by variable oVCur in my examples)
You can use Macro Recorder to get some UNO commands
- set paragraph properties
.PageDescName=.PageStyleName
→ in same example oVCur.PageDescName=oVCur.PageStyleName
It can be represented by visible cursor (oVCur) or also by Text Cursor (oDoc.Text.createTextCursor)
source: book from A. Pitonyak OpenOffice Macros Explained → chapter 14.2.1 Listing 339.
But it seems the web www.pitonyak.org isn’t functional, so I uploaded the macro book here: Andrew-Pitonyak-OpenOffice.org-Macros-Explained-OOME-40.pdf | Ulož.to Disk
Unfortunately your example file is bigger and more chaotic for me than I thought :-(, for example there is a lot of “IN THE COURT OF” but only one “Proceeding is closed”.
But operations you want are still the same or similar. Find something via SearchDescriptor, move cursor to some position and change some properties of cursor.
You can also use Text Cursor, or Table Text Cursor for text in table cells. Yes, it takes some time to understand and use it alone, but A. Pitonyak’s book is really good source for these operations :-).