Adding x blank Pages

Writing a book, Automating Document Production - Discuss your special needs here
Post Reply
darell108
Posts: 1
Joined: Thu Nov 10, 2016 10:54 am

Adding x blank Pages

Post by darell108 »

Hi

I am trying to make a Macro to print card numbers on to CR80 cards.

The method that appears the best way to do this would be to use the page numbering tool in writer.

How would I script the macro to set the start page number x and add y number of blank pages

For example I wanted to start at page number 9000 and create 100 pages with no text in them other than the page number in the bottom left.

Thanks
Windows 7 Open Office 4.1.3
FJCC
Moderator
Posts: 9574
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Adding x blank Pages

Post by FJCC »

This isn't quite right but it should get you started.

Code: Select all

oVC = ThisComponent.CurrentController.ViewCursor
oVC.jumpToPage(6)
oVC.jumpToEndOfPage()
oText = ThisComponent.Text
Curs = oText.createTextCursorByRange(oVC.End)
for i = 1 to 10
	Curs.gotoEndOfParagraph(FALSE)
	oText.insertControlCharacter(Curs.End, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
	Curs.BreakType = com.sun.star.style.BreakType.PAGE_BEFORE
next i
If the page style includes a footer with the page number, the new pages will have that.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Post Reply