[Solved] Apply page style to all pages...

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
cheuschober
Posts: 19
Joined: Mon Aug 17, 2009 5:45 pm

[Solved] Apply page style to all pages...

Post by cheuschober »

Hi.

Is there a way to apply a page style to all pages?

I have a post-mailmerge document that (for page numbering purposes) needs to have a single page style applied to all pages. When a MM happens each page is given it's own -- I just want them all back to Default.

I was hoping they're be a way to do it through the gui that I could catch with the macro recorder and just understand by analyzing its output but I can't seem to figure it out. Even if there's not a way to do so document-wide, is there an iterable collection of pages that I can then apply the style to?

Many thanks,
-C
Last edited by cheuschober on Tue Aug 18, 2009 5:24 pm, edited 1 time in total.
OpenOffice.org 3.1.0
Fedora 11
JohnV
Volunteer
Posts: 1585
Joined: Mon Oct 08, 2007 1:32 am
Location: Kentucky, USA

Re: Apply page style to all pages...

Post by JohnV »

I think this is what you want. If not attach a copy of a short post merge document.

Code: Select all

Sub ChangePageStyle
oVC = ThisComponent.CurrentController.getViewCursor
oVC.JumpToFirstPage
Do 
 oVC.PageDescName = "Standard" 'Internal name for Default.
Loop While oVC.JumpToNextPage
End Sub
cheuschober
Posts: 19
Joined: Mon Aug 17, 2009 5:45 pm

Re: Apply page style to all pages...

Post by cheuschober »

JohnV,

You are a champ. I never thought it'd be so easy or simple.

Many thanks!
-C
OpenOffice.org 3.1.0
Fedora 11
marcopivetta
Posts: 1
Joined: Wed Apr 21, 2010 8:04 pm

Re: [Solved] Apply page style to all pages...

Post by marcopivetta »

John V: you saved my life. Your contribution should be implemmented in the main system of the writer as an option like "aply styles to all pages".
BROFFICE 3.1 on Windows
Post Reply