Setting some headers and footers

S

Sol Apache

I have a template with three sections and a userform from which the front
page title, mmm yyyy, and various headers are automatically inserted.

The first two sections have headers and footers different from the third
section¹s - which starts the main part of the document - and so section 3Œs
header and footer are not set to ³same as previous².

The form works fine if a document has only three sections.

The problem is that if the user adds new sections after the third, or pastes
or imports from other documents, then the headers may not be the same as
those in section 3 (all headers and footers from the third section onwards
should be the same).

Also the userform can be used over and over to change the front page title
and the headers of the first three sections but when there are more than
three, then they may not change.

How can I set the macro to change the headers and footers from the third
onwards? There can be any number of sections after the third section. I
guess I need a line of code which says all headers and footers after section
3 should be the same as those of section 3 and/or a loop. I do not know how
to do this.

Thanks for any help




Sol
 
J

Jezebel

Dim pSection as long

for pSection = 3 to activedocument.Sections.Count
ActiveDocument.Sections(pSection).Footers(wdHeaderFooterPrimary). .....
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top