The "quick and dirty" way is to use
With ActiveDocument .PrintPreview .ClosePrintPreview End With
Alternatively
Sub updateHeaderFooterFields()
Dim i as Long With ActiveDocument For i = 1 to .Sections.Count With .Sections(i) .Headers(wdHeaderFooterPrimary).Range.Fields.Update .Footers(wdHeaderFooterPrimary).Range.Fields.Update End With Next i End With End Sub
-- Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis.
Doug Robbins - Word MVP
"Barry" <Barry[ at ]discussions.microsoft.com> wrote in message news:18B2AE76-6BF4-4618-A763-DF9E50EF6FCA[ at ]microsoft.com...
[Quoted Text] >I am trying to create a Word'03 template that includes a few form text >fields > that I want to populate the header and footer of the document, and change > when the user changes the text in those fields. > I have done this for one section, the first section is the first page and > never displays the header/footer, but users can create new sections > throughout the document. > Code is called on exit from the form fields and looks like this: > > Sub updateHeaderFooterFields() > With ActiveDocument.Sections(2) > .Headers(wdHeaderFooterPrimary).Range.Fields.Update > .Footers(wdHeaderFooterPrimary).Range.Fields.Update > End With > End Sub > > So, how do I update al headers/footers in all sections? > Thx, > Barry
|