Please Note: This article is written for users of the following Microsoft Word versions: 2007 and 2010. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Automatically Updating Fields and Links.

Automatically Updating Fields and Links

by Allen Wyatt
(last updated January 23, 2013)

14

Stephanie wondered if there is a way in Word to force the updating of all fields and links in a document when either opening or saving (closing) the file. She knows that she can force updates prior to printing, but she was looking, specifically, for the open or close method of updating.

You can automatically update both fields and links when you print a document, but Word treats the two items differently when you are opening a file. Word provides a way to always update your links when opening a document. You can do this by following these steps:

  1. Display the Word Options dialog box. (In Word 2007 click the Office button and then click Word Options. In Word 2010 display the File tab of the ribbon and then click Options.)
  2. Click on Advanced at the left side of the dialog box. (See Figure 1.)
  3. Figure 1. The General area of the Word Options dialog box.

  4. In the General area (scroll down a bit to see it), make sure the Update Automatic Links at Open check box is selected.
  5. 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.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (978) applies to Microsoft Word 2007 and 2010. You can find a version of this tip for the older menu interface of Word here: Automatically Updating Fields and Links.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Storing AutoText Entries with a Document

AutoText entries can provide quite a bit of flexibility and power in a document. If you want to share those entries with ...

Discover More

Pulling a Phone Number with a Known First and Last Name

When using an Excel worksheet to store data (such as names and phone numbers), you may need a way to easily look up a phone ...

Discover More

Word Count is Zero

If you use the Word Count tool and are surprised that it returns a count of 0, it could be because of what you selected prior ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Inserting the User's Address

If you enter your address into Word, you can insert that address anywhere you want in a document by using a single field. ...

Discover More

Using Fields for Fractions

Want a quick way to create fractions? You can do it by using fields, as described in this tip.

Discover More

Inserting a Page Number Field

The PAGE field is used to indicate the current page number on which the field occurs. If you want to add this field to your ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 + 6?

2017-02-07 21:39:41

C Perkins

At least in Word 2013, one can also go to File | Options | Display, then down to the Printing Options section. There are two checkboxes there that correspond to the UpdateFieldsAtPrint and UpdateLinksAtPrint properties shown in the macro. This helps avoid having to use macros, especially in Word 2013 which requires a special "macro-enabled" format for the word doc. It still does not update automatically without printing, but at least the output will be up-to-date.


2016-11-24 05:12:10

Gareth

In case anyone is wondering where it is saved - it is a Group Policy setting : "Update fields before printing"


2016-11-23 12:04:40

Pierre

Hi, I'm using the macro with Word 2010 and for some reason, the fields PAGE and NUMPAGES will not be updated in footers after page 4.

In a 10 pages document, I would have 1 of 4, 2 of 4, 3 of 4, and 4 of 4 starting on page 4 until the end?

Any idea why NUMPAGES stocks is stock at 4 for all pages? Why does PAGE stop incrementing after page 4?

It does the same for any documents with different number of pages.

Thanks


2016-10-13 12:09:42

Gareth

Does anyone know where this setting is saved?
Some of our users have it ticked and some don't.

Is it saved in the normal template?


2016-05-02 23:44:58

Alan

None of these methods work for all fields in the header/footer ?


2015-12-28 00:16:43

Kevin

My facts - F9 doesn't update my fields. Ryan's macro does but it puts "Go to..............Page Break........" in front of the first field where no Page Break existed.
With "View Field Codes" turned On, the fields come back to the page where the "Go To" is.
Print Preview does update the fields.


What do I need to check to get F9 to update links?
What in Ryan's code puts the "Go to..............Page Break........" , so as to avoid that (or other code)?


2015-06-25 10:56:35

Don Martin

Press the F9 key to update fields.


2015-04-29 07:10:57

Elad

I was looknig for a way to update indexes (fields) in my word document after adding a new index (field), which caused all the following indexes to have incorrect (old) value.
Ryan's macro above helped me and did the work.
Thanks Ryan!


2015-02-23 06:58:29

Maryland, USA

Linda, yes there is a way: Copy the number from the table and paste it into the text as a hyperlink, uding Paste Special... Choose Rich Text for its formatting to match the surrounding text.


2015-02-22 15:46:49

Linda

Is there a way to link a number from a Word table to the same number referenced in text (same document) so that it will update in text if changed in the table?


2014-10-15 23:20:07

Joe

Very helpful post. I can confirm that links between Excel 2013 and Word 2013 do NOT update correctly (with or without the setting box checked to do so). Using this script forces the update very smoothly. Thank you!


2014-07-04 01:42:24

Ryan

Sub UpdateAllFields()

Dim aStory As Range
Dim aField As Field

For Each aStory In ActiveDocument.StoryRanges
For Each aField In aStory.Fields
aField.Update
Next aField
Next aStory

End Sub


2014-05-21 08:20:15

Sheldon

Many years ago, I set Word up to update fields and links on printing. A few years ago, this great feature stopped working. Our IT guys said it was a known bug in a Microsoft service pack, but I'm not convinced, as other people say their automatic updates still work. Is there some other setting than the one shown above that affects automatic updating?


2013-09-25 11:56:16

RB

The AutoOpen () macro works wonders. My settings meant that Word should have been updating the linked files, but there was no consistency and I couldn't puzzle out what was happening... running AutoOpen () updates them perfectly :-)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.