Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Setting some headers/footers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sol Apache - 31 Oct 2005 21:14 GMT
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 

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.