How do I update all fields in a Word document?
Solution 1:
Go into the print settings, select update fields. Then go to print, or print preview your doc.
Et voilà, all fields are updated!
Solution 2:
I just do Ctrl+A - to select everything - and then F9 to update the lot.
Although, this misses headers and footers, but they update when you print/print-preview IIRC.
###Update
I've found the following macro. On a quick test it updated tables of contents, fields within paragraphs, fields within the header and footer, and fields within a floating text box figure.
Hopefully that covers everything that you need, if not please indicate what is still failing to update.
Source: http://www.gmayor.com/installing_macro.htm
Sub UpdateAll()
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
oStory.Fields.Update
If oStory.StoryType <> wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
oStory.Fields.Update
Wend
End If
Next oStory
Set oStory = Nothing
End Sub
Solution 3:
This page looks interesting:
If you are using Word 2007, the process is a bit different: Click the Office button and then click Word Options. Word displays the Word Options dialog box. Click on Advanced at the left side of the dialog box. (Click here to see a related figure.) In the General area (scroll down a bit to see it), make sure the Update Automatic Links at Open check box is selected. Click on OK. That setting should make sure that all your links are always up to date. If you want to update the fields when the document is opened, you'll need to use a macro to accomplish the task. Specifically, you'll need to use either an AutoOpen or AutoClose macro, depending on whether you want to update the fields when the document opens or closes. The following is an example of an AutoOpen macro you can use.
Sub AutoOpen()
With Options
.UpdateFieldsAtPrint = True
.UpdateLinksAtPrint = True
End With
ActiveDocument.Fields.Update
End Sub
Note that the macro makes sure that the options are set to force updating the fields and links when printing occurs, then it updates all the members of the Fields collection in the document. If you, instead, wanted to update the fields at closing, you could use this macro:
Sub AutoClose()
ActiveDocument.Fields.Update
End Sub
This macro is much shorter because there is no need to set the update-on-print options when you are exiting the document.exiting the document.
Solution 4:
Word 2010:
Right click the ribbon, customise the ribbon, choose command from "all commands" search for "update" and add it where you want.
This button updates only selected fields.
Then, to update all fields, press Ctrl + A then this button.
Solution 5:
If you want to properly update all headers and footers, this worked for me:
Dim oStory As Range
Dim oSection As Object
Dim oHeader As Object
Dim oFooter As Object
For Each oStory In ActiveDocument.StoryRanges
oStory.Fields.Update
Next oStory
For Each oSection In ActiveDocument.Sections
For Each oHeader In oSection.Headers
oHeader.Range.Fields.Update
Next oHeader
For Each oFooter In oSection.Footers
oFooter.Range.Fields.Update
Next oFooter
Next oSection