How do I make Word 2007 update all fields upon save? This should include fields in headers and footers.
If possible, no macros and VB code please. I want to keep the documents clean.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Since Ctrl+A and Ctrl+F9 will not address the headers/footers, and possibly other stories, VBA or other code will be required, which would probably be a question best fit for Stack Overflow.
VBA code might look like:
Sub updateFieldsIncludeHeadersFooters() Dim sec As Section Dim hdrftr As HeaderFooter ActiveDocument.Fields.Update 'address the fields in the main text story 'now go through headers/footers for each section, update fields per range For Each sec In ActiveDocument.Sections For Each hdrftr In sec.Headers hdrftr.Range.Fields.Update Next For Each hdrftr In sec.Footers hdrftr.Range.Fields.Update Next Next End Sub
I would not recommend taking over Word's Save event to run this automatically, but rather hooking it to a button or have some other way for the user to explicitly call it.