Autoupdate field codes when property is changed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to automatically update document property field codes without
using the "Update Field" menu command? I did some work for a company recently
and we updated the field codes through the Document Properties property page
dialog. For example, when we changed the Title field code using the dialog
box and closed the dialog box, the change was automatically reflected in the
field code of the document.
 
I tried to speed up things some by recording a macro and button for the
operation. I made buttons for update all fields, shade fields, show field
codes and unshade fields.
 
CTRL-A doesn't highlight the header and footer for updating. Did you create
a separate macro for those elements? Or did your primary macro get kinda
elaborate to incorporate them?
 
I modified some VBA code to update the headers too.

Sub UpdateFields()
'
' UpdateFields Macro
' Macro recorded 6/21/2007 by Matthew B. Lambert
'
Selection.WholeStory
Selection.Fields.Update
Selection.WholeStory
ActiveWindow.ActivePane.View.SeekView = _
wdSeekCurrentPageHeader
Selection.WholeStory
Selection.Fields.Update
Selection.WholeStory
End Sub
 
Back
Top