h1

Word: Update fields in headers and footers

January 25, 2008

You’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

  1. Switch from Print Layout mode to Normal Layout.
  2. Press Ctrl+A to select the entire document.
  3. Press F9 to update the fields.
  4. 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:

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]

48 comments

  1. except of course if the document is protected with a password – then Ctrl-A will not work..


  2. Doesn’t help for Word 2007. Any ideas how to solve the issue for the new suite?


  3. My 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.


  4. […] 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 […]


  5. On 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?


  6. Word 2007 unstructions don’t work


  7. Does not work for Word 2007. Anyone found a way?


  8. I’ve done some investigating and added details for updating fields in headers and footers in Word 2007.


  9. @Rhonda: “Print Preview” works for me in Word 2007. Thanks!


  10. Been tearing my hair out with this for ages, thanks for the tip!!


  11. For 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.”


  12. Thanks so much! The ‘fix’ for updating Word 2003 footers is going to save me significant time.


  13. […] Word: Update fields in headers and footers (6,149) […]


  14. […] Update all fields, including those in headers and footers: Switch to Draft mode, then Ctrl+A to select the entire document, then press F9 […]


  15. Hi 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?


  16. I’m not sure that you can change this to be a fixed path.
    Possible 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


  17. 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.


  18. I 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


  19. Thanks for this information. I’ll add that link to my post on adding file names and paths to a document.


  20. For 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.


  21. THANKYOU so much, extremely useful :)


  22. […] Word: Update fields in headers and footers […]


  23. The 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()
    If Not ActiveDocument.Saved Then
    ActiveDocument.Save
    UpdateFields
    ActiveDocument.Save
    End If
    End Sub


  24. Slightly improved version of previous UpdateFieldsAndSave macro (with run-time errors handling):

    Sub UpdateFieldsAndSave()
    On 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


  25. One more slightly improved version of previous UpdateFieldsAndSave macro:

    Sub UpdateFieldsAndSave()
    On 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


  26. 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?


  27. You 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.


  28. Guess 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.


  29. I 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


  30. Oh, 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


  31. Yep, 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…)


  32. I 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,
    Sid


  33. 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.


  34. If 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 =)


  35. Thanks Marcus!


  36. For 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.


  37. You guy… word option and checked the box works for me in 2007. Love from Malaysia.


  38. AMAZING. 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.


  39. Worked for me and I was gratefully back to work on this research proposal in an instant. THANK YOU! one cuppa joe headed your way.


  40. How could Microsoft break this?!?!? Is there no beta testing at all?


  41. Does anyone know if this problem has been fixed in Word 2010?


  42. Hi 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


  43. Thanks, 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.)


  44. Any tips on this using Word 13


  45. Hi 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


  46. I 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


  47. […] There are other ways, mostly using macros; see The CyberText Newsletter. […]



Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.