[Libreoffice] Copy Header/Footer from one Writer document to another

Cor Nouws oolst at nouenoff.nl
Fri Jul 1 08:38:24 PDT 2011


Hi Grover,

Grover Blue wrote (01-07-11 17:03)
> Thanks for getting back to me Cor.  I did copy the page style by
> creating a new style on document 1 with a random name, copying over the
> page style props from document 2, then applying the page style to page
> for which the document was inserted.

That sounds fine, I would think.

> I asked this similar question here:
> http://user.services.openoffice.org/en/forum/viewtopic.php?f=25&t=38739&p=180951
> <http://user.services.openoffice.org/en/forum/viewtopic.php?f=25&t=38739&p=180951>
>
> ...
> I mostly got it working, except for the copying of the actually
> header/footer text. Whenever I read in a new document, the header and
> footer text is always applied to the first page (or Default page style),
> instead of the newly created page style.

OK, at the first paragraph of a new page, you have to add both manual 
break, and set the property new page style to xxx
You can see that in the UI

> ...

> I've included all the relevant code below. Please note that I had to
> leave the PAGE BREAK code as is, otherwise the insertion of a new
> document would not occur on a new page. I may be able to leave out the
> Section Break, but I for now it shouldn't be a problem.

As written, breaks are essential, but maybe you need some additional 
property there.
Thanks for the code, but that will take more time for me to understand 
then I can spent. Sorry for that.
Cheers,

-- 
  - Cor
  - http://nl.libreoffice.org



More information about the LibreOffice mailing list