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 they are not
made ³same as previous². The form works fine if a document has only three
sections. All headers and footers from the third section onwards should be
the same.
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. 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.
Thanks for any help
Sol
Jean-Guy Marcil - 02 Nov 2005 22:45 GMT
Sol Apache was telling us:
Sol Apache nous racontait que :
> I have a template with three sections and a userform from which the
> front page title, mmm yyyy, and various headers are automatically
[quoted text clipped - 17 lines]
>
> Thanks for any help
Here is an example of something you could implement:
Sub ResetHedersFooters()
With ActiveDocument
If .Sections.Count > 3 Then
For i = 4 To .Sections.Count
.Sections(i).Headers(wdHeaderFooterPrimary).LinkToPrevious =
True
.Sections(i).Footers(wdHeaderFooterPrimary).LinkToPrevious =
True
Next
End If
End With
End Sub

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org