Word 2003 Custom Fields

K

Kerry

Hi

I have created a template with headers & footers for page 2 onwards. The
template however is a one page template, the headers and footers present
themselves as they should, in the event of a second page being required. The
problem I am having is that the header for page 2 onwards holds a custom
field.

When page 2 is automatically created by typing lots of text the custom field
does not update. The only way to update the field is to print it, F9 it or
print preview. How can I have the header of my page 2 onwards custom field
updated when no page 2 exists until I start typing into my document?

Thanks very much in advance for your help.

Kerry.
 
D

Doug Robbins

Using the following should do it whether the primary header/footer is
visible in the document or not:

Dim i As Long
With ActiveDocument
For i = 1 To .Sections.Count
.Sections(i).Headers(wdHeaderFooterFirstPage).Range.Fields.Update
.Sections(i).Headers(wdHeaderFooterPrimary).Range.Fields.Update
.Sections(i).Footers(wdHeaderFooterFirstPage).Range.Fields.Update
.Sections(i).Footers(wdHeaderFooterPrimary).Range.Fields.Update
Next i
End With

--
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
 

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