Update fields in Header/Footer

M

ML

Is there a way to force the fields inside the header/footer to
refresh/update but on for the page the user is currently on?
I want to be able to update this without the need to update all sections and
pages so that it is much faster when just dealing with one page.
 
D

Doug Robbins - Word MVP

Probably this

With Selection.Sections(1)
.Headers(wdHeaderFooterPrimary).Range.Fields.Update
.Headers(wdHeaderFooterFirstPage).Range.Fields.Update
.Footers(wdHeaderFooterFirstPage).Range.Fields.Update
.Footers(wdHeaderFooterPrimary).Range.Fields.Update
End With

but I would be very surprised if you were able to detect the difference in
performance between that and

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

which will update the fields in all of the headers and footers in the
document.


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

ML

The performance issues is because Word repaginates it seems no matter what
you do and in a long document it slows things down too much.
 
C

Charles Kenyon

Headers and footers are not in just one page, but one section (which may be
the entire document).
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
J

Jezebel

Updating fields in headers and footers for some vs all sections will have no
effect on Word's repagination.
 
M

ML

I am well aware of that. I was just hoping there might be a way to just
refresh the current page fields or something along those lines.
 
M

ML

Well despite headers and footers not being page specific you can make them
have page specific info displayed in them.
Thanks though for your comment, very helpful.
 

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