Word: Update fields in headers and footers
January 25, 2008You’ve got a Word document with field codes in it (e.g. auto generated TOC, bookmarks and cross-references, file name in the footer etc.). But when you update the fields using F9, the fields in the headers and footers don’t get updated. Frustrated, you realize you have to go in to the header and footer separately, select all, then press F9.
But you don’t. There’s an easier way to update all fields at once, even those in the headers and footers.
Word 2003
- Switch from Print Layout mode to Normal Layout.
- Press Ctrl+A to select the entire document.
- Press F9 to update the fields.
- Switch back to Print Layout mode.
Word 2010 and later
Here’s how easy it is to do in Word 2010 and later: Go into Print Preview mode (File > Print, but DO NOT print), then return to the document. (Thanks to Greg Maxey on the Microsoft Office Discussion Forum for that trick!)
If not everything updates successfully with the Print Preview trick (some fields don’t appear to), you may need to try some of these options:
- Open the header/footer, select all (Ctrl+A) then press F9.
- http://word.tips.net/Pages/T000522_Including_Headers_and_Footers_when_Selecting_All.html (The only macro on this page that worked correctly for me was the Sub MyUpdateFields3() macro.)
- http://www.gmayor.com/installing_macro.htm (This one is about installing macros, using the UpdateAll macro as an example. The UpdateAll macro works well for updating fields in headers and footers (and is shorter than the WordTips one), and there are instructions for adding this macro to the Quick Access Toolbar and/or a keyboard shortcut too.
- Another macro from Graham Mayor on the discussion forum: https://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.word.docmanagement&mid=8896afa8-0609-4c8a-b8bf-c9ae44a0733c
- Macro from Greg Maxey on the forum: https://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.word.docmanagement&mid=ecdf3f6c-969e-4dca-b932-b037e3e1bf2c
If you create one of these macros but don’t add it to the Quick Access Toolbar or to a keyboard shortcut, then you will need to run it manually (Developer tab, > Macros > select the macro name, then click Run). There’s probably a way to add them to the AutoOpen or AutoClose functions, but I haven’t checked that out. If anyone can alert me to a web page that discusses how to do this, I’d be most grateful (I’m a bit of a newbie with macros!)
[Updated with revised Word 2010 and later information, June 2009]
except of course if the document is protected with a password – then Ctrl-A will not work..
by luke wilkinson March 13, 2008 at 5:27 amDoesn’t help for Word 2007. Any ideas how to solve the issue for the new suite?
by Melvyn March 23, 2008 at 4:48 pmMy apologies – I forgot to put Word 2003 in the title of this post. I’ve corrected that now.
I’m not using Word 2007 yet, so I can’t help you with that.
by sandgroper14 March 24, 2008 at 12:37 am[…] thing I noticed was that my headers and footers didn’t update with the custom values automatically on publishing. That’s because I have another APM that […]
by Add custom properties to Author-it’s Word output « CyberText Newsletter August 3, 2008 at 8:03 amOn Word 2003 if one creates a document with a file name in the footer and save it, the next time you open that file and save as with a different name the footer will up date. However, Word 2007 does not updates, it keeps the original footer info.
Does anyone knows how to correct this?
by Carlos October 2, 2008 at 9:15 amWord 2007 unstructions don’t work
by Stella Noyed June 3, 2009 at 11:23 pmDoes not work for Word 2007. Anyone found a way?
by netjeff June 12, 2009 at 1:16 amI’ve done some investigating and added details for updating fields in headers and footers in Word 2007.
by Rhonda June 14, 2009 at 4:19 pm@Rhonda: “Print Preview” works for me in Word 2007. Thanks!
by netjeff June 17, 2009 at 3:26 amBeen tearing my hair out with this for ages, thanks for the tip!!
by MarkC June 19, 2009 at 6:54 pmFor people with Word 2007 problems, go to “Office” menu, then select “Word Options”, then “Display” submenu, and make sure “Update fields before printing” is checked. Then the “print preview” trick will work to update all fields.
I wish there was a checkbox(es) for “update fields before save” and/or “update fields after load.”
by James Olsen July 15, 2009 at 10:26 pmThanks so much! The ‘fix’ for updating Word 2003 footers is going to save me significant time.
by Gary October 30, 2009 at 6:40 am[…] Word: Update fields in headers and footers (6,149) […]
by Revisiting another year of blogging « CyberText Newsletter December 31, 2009 at 10:31 am[…] Update all fields, including those in headers and footers: Switch to Draft mode, then Ctrl+A to select the entire document, then press F9 […]
by Tips for efficiently editing in Word by Communications from DMN June 24, 2010 at 7:34 amHi guys
I’m using word 2007. The print preview trick has been working wonders but I can’t figure out how to turn off the automatic footer update so it stays as my document name and file path when I email my documents out instead of changing to the person who has opened the documents? Can anyone help?
by Rebecca Bamford July 6, 2010 at 11:27 pmI’m not sure that you can change this to be a fixed path.
by Rhonda July 7, 2010 at 5:56 amPossible workaround:
* type it in directly (i.e. NOT a field) — quick way to change it from a field to plain text is Ctrl+Shift+F9
* create a PDF of the doc and email the PDF
Thanks. Unfortunately, the 2007 approach didn’t work for me, even with setting “Update fields before printing.”
But, I was able to do the 2003-style trick in 2007. Instead of “Normal layout,” it’s called “Draft” in 2007.
by Wallace White July 10, 2010 at 12:53 amI found this solution on Microsoft.com.
I have a field in my footer to display file name, when the file name is changed it will update in Print mode or automatically as long as the macro is enabled.
I found the file extension needs to be .doc or .docm otherwise the macro will not run.
Hope this helps.
http://support.microsoft.com/kb/832897
by Robin Goldberg July 17, 2010 at 2:56 amThanks for this information. I’ll add that link to my post on adding file names and paths to a document.
by Rhonda July 17, 2010 at 8:11 am[…] https://cybertext.wordpress.com/2008/01/25/update-fields-in-headers-and-footers/ for other […]
by Word: Putting the file path in the document « CyberText Newsletter July 19, 2010 at 5:34 amFor Word 2007, the only trick outside of a macro that worked for all fields, in all locations (as far as I could discover) is to actually print; Though you can do a pdf print using e.g. PDFCreator, and cancel it at the save prompt.
Of course the ‘update fields before printing’ must be checked.
by Maartenmk September 18, 2010 at 12:04 amTHANKYOU so much, extremely useful :)
by Shel January 13, 2011 at 11:30 am[…] Word: Update fields in headers and footers […]
by 2010 blog statistics « CyberText Newsletter January 13, 2011 at 1:25 pmThe best solution I found with “update fields on save” problem is the following two simple macros (note UpdateFieldsAndSave macro depends on (or calls) UpdateFields macro):
Sub UpdateFields()
‘
‘ UpdateFields Macro updates all fields in the active document
‘
‘
Dim oStoryRange As Range
Dim oField As Field
For Each oStoryRange In ActiveDocument.StoryRanges
For Each oField In oStoryRange.Fields
oField.Update
Next oField
Next oStoryRange
Set oStoryRange = Nothing
Set oField = Nothing
End Sub
Sub UpdateFieldsAndSave()
by Markas January 17, 2011 at 3:06 pmIf Not ActiveDocument.Saved Then
ActiveDocument.Save
UpdateFields
ActiveDocument.Save
End If
End Sub
Slightly improved version of previous UpdateFieldsAndSave macro (with run-time errors handling):
Sub UpdateFieldsAndSave()
by Markas January 17, 2011 at 4:04 pmOn Error Resume Next
If Not ActiveDocument.Saved Then
ActiveDocument.Save
If Not (Err.Number > 0) Then
UpdateFields
ActiveDocument.Save
End If
End If
End Sub
One more slightly improved version of previous UpdateFieldsAndSave macro:
Sub UpdateFieldsAndSave()
by Markas January 18, 2011 at 4:22 pmOn Error Resume Next
Err.Clear
If Not ActiveDocument.Saved Then
ActiveDocument.Save
If Err.Number = 0 Then
On Error GoTo 0
UpdateFields
ActiveDocument.Save
End If
End If
End Sub
I have exactly the opposite problem: Trying to open an old file (from 1995) that has date fields in it, which I want left as they were when the file was last saved, so I can make a PDF with the original document date preserved. But Word 2007 automatically updates the date fields on opening the document. Is there any way to force this OFF?
by Tim March 22, 2011 at 12:26 amYou need to detach the fields from the dates. Assuming the old dates hold on opening the document, select the date field and press CTRL+SHIFT+F9 to remove the hyperlink (field) for it. You may have to do this in each footer if you have several sections.
by Rhonda March 22, 2011 at 8:23 amGuess I wasn’t clear – the old dates NEVER appear; when Word opens the document, it fills in the current date. (It’s not “changing” the date, because there wasn’t a date there in the first place, only a field.) So as far as I can tell, there’s no way to preserve the old dates in a document that has these fields.
by Tim March 22, 2011 at 11:17 amI couldn’t find any way to preserve these either.
The only option I found regarding updating fields (or not) was under the Print options in Tools (Word 2003) or Word Options > Advanced > General > Update automatic links at open (Word 2007). However, I doubt these will help you AFTER the doc has already been updated.
–Rhonda
by Rhonda March 23, 2011 at 11:11 amOh, one other option is to note the date created/last updated in the document’s Properties and type that date manually into these docs. Very painful if you have lots of them….
–Rhonda
by Rhonda March 23, 2011 at 11:13 amYep, that’s what I had to do. Fortunately this doesn’t come up often, and there were only two fields in this document, so not a real big deal. Thanks for confirming that I hadn’t missed something. (I remember reading a few years ago that MS polled a bunch of Word super-users to find out what new features they would like to see in the next release. A large majority of the responses were features that already existed, but were buried so far down in sub-menus, even the super-users dodn’t know about them…)
by Tim March 24, 2011 at 12:10 amI hope the following steps will help to set and update all the headers and footers in Word 2007 doc.
1. Double click the header/footer on the first page of the document.
2. Type in any text which you would like to be updated in footer/header of every page.
3. Go to next page, double click on the header/footer. As you will double click on the header/footer you will see an additional menu after “View” will display, i.e. “Design”.
4. Underneath the Design menu, there will be certain sub menus such as Header & Footer, Insert etc.
5. Go to the sub menu Navigation and select “Link to Previous”.
You will see the header/footer updated on every page.
I hope this helps. Please let me know if you have any questions/suggestions.
Thanks,
by Sid April 21, 2011 at 2:53 amSid
That’s the best way to set the original headers and footers, Sid, but when a doc comes with them already set and with multiple section breaks for landscape/portrait and/or odd/even pages, ‘Link to Previous’ is not an option. While ‘Link to Previous’ is great for setting up the original headers, you have to break the link for those other cases.
I work on 200+ page scientific reports with up to 80 section breaks. These docs have different headers/footers for odd/even and first pages, and different orientations for landscape/portrait pages and A4/A3 pages. They also have Roman numerals for the front matter pages and Arabic numerals for the main text (we finally got rid of separate appendix page numbering, thank goodness).
The headers/footers in the docs I work on are populated with fields, so it’s the reason I wrote this post on how to update those fields.
by Rhonda April 21, 2011 at 6:26 amIf you want a cheap easy way to update ALL fields. Just let word do it for you:
Sub UpdateALL()
ActiveDocument.PrintPreview
ActiveDocument.ClosePrintPreview
End Sub
Seems to be the only way to really update all fields (including textboxes, footers, headers, etc).
Hope this helps =)
by Marcus Bergman April 27, 2011 at 10:25 pmThanks Marcus!
by Rhonda April 28, 2011 at 6:14 amFor Word 2007, no matter your settings, this “auto-update” only works if you actually print the document (or at least print to printer that is offline and cancel it later). Using Print Preview shows you during the preview and after you return to the document that the Fields are updated, even if you re-save it, but once you open it again the changes are gone.
by Thomas M May 15, 2011 at 9:23 amYou guy… word option and checked the box works for me in 2007. Love from Malaysia.
by Famie Shafie February 15, 2012 at 10:58 amAMAZING. Thank you so much for this!!! It’s incredible the help you can find on the internet these days, and the print-preview trick is just one example of that! Thanks again.
by Leah March 29, 2012 at 4:29 amWorked for me and I was gratefully back to work on this research proposal in an instant. THANK YOU! one cuppa joe headed your way.
by sydspinnin April 16, 2012 at 12:50 pmHow could Microsoft break this?!?!? Is there no beta testing at all?
by John Smith June 6, 2012 at 11:36 pmDoes anyone know if this problem has been fixed in Word 2010?
by Anne November 6, 2012 at 4:15 amHi Anne
No. At least not according to this article posted a few days ago: http://wordribbon.tips.net/T012247_Field_in_Footer_Wont_Update.html
–Rhonda
by Rhonda November 6, 2012 at 5:23 amThanks, Rhonda, I went to the tips site you recommended and tried the styleref field for this issue, and it works beautifully! (I’m using Word 2010, but I think it would work in earlier versions too.)
by Anne November 7, 2012 at 2:53 amAny tips on this using Word 13
by Dianne Prior September 18, 2013 at 5:18 pmHi Dianne
I haven’t used Word 2013 at this stage, but I would have thought that the Print Preview method for Word 2007/2010 would also work for Word 2013. If the changes don’t hold, print to a virtual ‘printer’ such as Adobe PDF and see if that makes them stick.
–Rhonda
by Rhonda September 19, 2013 at 6:14 amI use Word in Office 2016 and have issue cannot update all page number in footer automatically.
Then after some struggling, I figured out that the solution is block the page number then right / secondary click, then choose “Format Page Numbers…” instead of “Update Field”.
After a small window appears, choose “Continue from previous section”. Finally choose OK button then see the change.
-Nandax
by Nandax September 2, 2019 at 3:39 pm[…] There are other ways, mostly using macros; see The CyberText Newsletter. […]
by Referring twice to the same footnote in Word – Boot Panic October 22, 2021 at 5:11 am