Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi, How can I make all the fields in my document automatically update (e.g. like the page count field does by default) instead of having to manually click on each field in turn and update it?
Thanks. |
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi mlse,
Most, if not all, of your fields will update if you do a Print Preview. Also make sure you've checked the: .. 'update automatics links at open' option under Tools|Options|General .. 'update fields' and 'update links' options under Tools|Options|Print. If that's not enough for you, you can try the following macro: Sub RefreshFields() Dim TOC As TableOfContents ' Table of Contents Object Dim TOA As TableOfAuthorities ' Table of Authorities Object Dim TOF As TableOfFigures ' Table of Figures Object Dim pRange As Range ' Word Range Object Call MacroEntry With ActiveDocument ' Loop through Story Ranges and update. ' Note that this may trigger interactive fields (eg ASK and FILLIN). For Each pRange In .StoryRanges Do pRange.Fields.Update Set pRange = pRange.NextStoryRange Loop Until pRange Is Nothing Next ' The following routines are necessary because the foregoing updates only page numbers ' in TOCs, TOAs and TOFs - field updating doesn't update TOC, TOA or TOF contents. ' Loop through Tables Of Contents and update For Each TOC In .TablesOfContents TOC.Update Next ' Loop through Tables Of Authorities and update For Each TOA In .TablesOfAuthorities TOA.Update Next ' Loop through Tables Of Figures and update For Each TOF In .TablesOfFigures TOF.Update Next End With Call AcceptTrackedFields Call MacroExit End Sub -- Cheers macropod [Microsoft MVP - Word] "mlse" .uk wrote in message ... Hi, How can I make all the fields in my document automatically update (e.g. like the page count field does by default) instead of having to manually click on each field in turn and update it? Thanks. -- mlse |
#3
![]() |
|||
|
|||
![]()
Thanks! I found a hacky work-around using references, but I will try your macro!
|
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto update fields when opening document, problems. | Microsoft Word Help | |||
Add fields that auto-update | Microsoft Word Help | |||
How to auto-update REF fields if related ASK field bookmark is upd | Microsoft Word Help | |||
Auto Update of formula fields | Microsoft Word Help | |||
Attempting to auto-update fields in a word document | Microsoft Word Help |