Word edit all fields

Word for Microsoft 365 Word 2021 Word 2019 Word 2016 Word 2013 More…Less

Sometimes you need to manually trigger an update of the information in fields like those used in a table of contents, headers and footers, cross-references, bookmarks, and formulas in tables. You can update fields one by one, or you can update all the fields in your document at once.

In this article

  • Update a field

  • Update all fields in a document

Update a field

  1. In a document you have open, right-click a field, such as a table of contents, a page number, or a cross-reference, and click Update Field.

    The right-click menu for a bookmark reference

    Notes: 

    • If you’re updating a table of contents, in the Update Table of Contents dialog box, select whether you want to update page numbers only or the entire table. Updating page numbers only simply updates the page numbers for the existing sections. It doesn’t add new sections to your table of contents. To update your table of contents with new sections from your document, select Update entire table.

      Update Table of Contents dialog box

    • If you’re having trouble distinguishing which parts of your text are fields, you can set all fields to show up with grey background. To do this, click FILE > Options > Advanced, and under Show document content, from the Field shading drop-down menu, select Always.

      In the Advanced screen, set "Field shading" to "Always."

Top of Page

Update all fields in a document

  1. Press Ctrl + A.

  2. Press F9.

  3. If your document has tables with fields or formulas, you might need to select each table separately and press F9.

    Tip: To make sure that you don’t forget to update your table of contents before you print the document, set Word to update fields automatically before printing. Click FILE > Options > Display, and under Printing options, select the check box for Update fields before printing.

    In the Display screen, select "Update fields before printing."

    Note: Sometimes a field is not updated because the item the field refers to no longer exists. The link or bookmark might also be broken. For more information, see Troubleshoot bookmarks.

Top of Page

See Also

Insert fields

Field codes in Word

Create or update a cross-reference

Update a table of contents

Use a formula in a Word or Outlook table

Create a table of contents

Need more help?

Update Fields in Your Microsoft Word Documents Manually or Automatically

by Avantix Learning Team | Updated April 6, 2021

Applies to: Microsoft® Word® 2010, 2013, 2016, 2019 or 365 (Windows)

If you have inserted fields in your Microsoft Word document, you can choose to update them manually or have them update automatically. For fields you update manually, you can update just one field or update all the fields in your Word document at once. Some fields, such as page numbers, will automatically update when you preview your document. Many fields are set by default to update when you open a document but you can also set an option in Microsoft Word to update fields when you preview your file.

You can insert fields in several ways in Word. Some fields are created when you use Word’s built-in features (such as inserting a table of contents, a cross-reference, a bookmark or a page number). Other fields can be inserted using the Field dialog box or can be entered using keyboard shortcuts.

Recommended article: How to Insert Built-in and Custom Fields in Microsoft Word

Updating a single field

You can update a single field manually in two ways:

  1. Right-click the field and select Update Field. Depending on the type of field, another dialog box may appear where you can select other options (this occurs for example, with a tables of contents).
  2. Click the field and press F9.

Update field appears in the drop-down menu when you right-click a field:

Context menu that appears when you right-click on a field to update the field.

Updating all fields in the body of a Word document

To manually update all fields in the body of a Word document:

  1. Click in the body of the Word document.
  2. Press Ctrl + A.
  3. Press F9.

Updating fields in headers, footers or text boxes

Some fields in headers, footers or text boxes must be updated separately.

To update fields in headers, footers or text boxes:

  1. Click in the header, footer or text box.
  2. Pess Ctrl + A to select all.
  3. Press F9.

Page fields do not need to be updated manually.

Updating a table of contents field

If you update a table of contents, another dialog box appears. In the Update Table of Contents dialog box, select Update page numbers only if no content has changed. Select Update entire table to update page numbers and content.

Updating fields before printing or previewing

You can set an option in Microsoft Word to ensure that all fields are updated automatically before previewing (to preview, click the File tab in the Ribbon and then click Print):

  1. Click the File tab in the Ribbon and click Options at the bottom. A dialog box appears.
  2. Click Display in the categories on the left.
  3. Scroll down to the Printing options area in the panel on the right.
  4. Ensure the check box for Update fields before printing is checked.
  5. Click OK.

The Word Options dialog box where Update field before printing has been checked appears as follows:

Updating all fields in Word showing dialog box with update fields before printing checked.

Preventing field updating

You can prevent fields from updating by locking them.

To lock a field so that it is not updated, click the field, and then press Ctrl + F11. To unlock a field so that it can be updated, click the field, and then press Ctrl + Shift + F11.

Displaying fields with grey shading

You can change your options in Microsoft Word so that all fields are displayed with grey shading (the shading does not print). This can be helpful to determine where you have fields in your document.

To display fields with grey shading:

  1. Click the File tab in the Ribbon and click Options at the bottom. A dialog box appears.
  2. Click Advanced in the categories on the left.
  3. Scroll down to Show document content area in the panel on the right.
  4. Select Always from the drop-down menu for Field shading.
  5. Click OK.

The Word Options dialog box with Field shading set to Always appears as follows:

Microsoft Word dialog box with Field Shading turned on.

You may not want to display field shading permanently. The default setting is Field shading when selected.

Fields are a very powerful way of using variable content in Microsoft Word documents. However, if fields do not update, your document can display errors or inaccurate content.

Subscribe to get more articles like this one

Did you find this article helpful? If you would like to receive new articles, join our email list.

More resources

How to Insert a Watermark in Word (like DRAFT)

14+ Word Selection Shortcuts to Quickly Select Text

How to Find and Replace in Word (and use Wildcards)

How to Superscipt or Subscript in Word (with Shortcuts)

How to Keep Text Together in Microsoft Word (Words, Lines or Paragraphs)

Related courses

Microsoft Word: Intermediate / Advanced

Microsoft Word: Designing Dynamic Word Documents Using Fields

Microsoft Word: Long Documents Master Class

Microsoft PowerPoint: Intermediate / Advanced

VIEW MORE COURSES >

Our instructor-led courses are delivered in virtual classroom format or at our downtown Toronto location at 18 King Street East, Suite 1400, Toronto, Ontario, Canada (some in-person classroom courses may also be delivered at an alternate downtown Toronto location). Contact us at info@avantixlearning.ca if you’d like to arrange custom instructor-led virtual classroom or onsite training on a date that’s convenient for you.

Copyright 2023 Avantix® Learning

Microsoft, the Microsoft logo, Microsoft Office and related Microsoft applications and logos are registered trademarks of Microsoft Corporation in Canada, US and other countries. All other trademarks are the property of the registered owners.

Avantix Learning |18 King Street East, Suite 1400, Toronto, Ontario, Canada M5C 1C4 | Contact us at info@avantixlearning.ca

Update all fields in a document

  1. Press Ctrl + A.
  2. Press F9.
  3. If your document has tables with fields or formulas, you might need to select each table separately and press F9.

Contents

  • 1 How do I update all fields in Word for Mac?
  • 2 How do I update all caption fields?
  • 3 How do I update all fields in Word without F9?
  • 4 How do you select all fields in Word?
  • 5 How do you insert a field that will automatically update in Word?
  • 6 How do I edit fields in Word?
  • 7 What does Ctrl Shift F9 do in Word?
  • 8 How do you edit a caption in Word?
  • 9 Why is F9 not working in Word?
  • 10 How do you update toggle fields in Word?
  • 11 How do I change all footers in Word?
  • 12 How do I turn off update fields in Word 2010?
  • 13 What is Shift F7?
  • 14 What is Alt F11?
  • 15 What does Alt F4 do in Word?
  • 16 How do I update all figure numbers in Word?
  • 17 How do you update cross references in Word?
  • 18 How do you reference a caption in Word?
  • 19 What is F mode key?
  • 20 How do I unlock my F keys?

How do I update all fields in Word for Mac?

Updating cross references in word for MAC

  1. Right-clicking an individual field & selecting Update Field from the contextual menu.
  2. Selecting the field then pressing F9 to update that field.
  3. Using Command+A then pressing F9 to update all fields in the document.

How do I update all caption fields?

Click anywhere in the document and press CTRL+A to select the entire document. Right-click, and then choose Update Field on the shortcut menu. All of the captions in the document should now be updated.

How do I update all fields in Word without F9?

To add to what Paul and Charles have said, many fields can be updated if you repaginate the document, which you can do if you switch to Print Preview and then go back to your previous view. You can press Ctrl+F2 (or Ctrl+P) and then ESC.

How do you select all fields in Word?

Put cursor in “Find what” text box and enter “^d” to find all fields. Next click “Find In” and choose “Main Document”. You will see all fields are in selection now. You can choose to highlight them as to stand out.

How do you insert a field that will automatically update in Word?

Insert a date that updates automatically

  1. On the Insert tab, in the Text group, click Date & Time.
  2. In the Date and time dialog box, select the format you want.
  3. Select the Update automatically check box. The date is inserted as a field and will update automatically.

How do I edit fields in Word?

  1. Right-click the field, and then click Edit Field.
  2. Do one of the following: If Field properties and Field options are displayed, select the formatting options that you want. If only the field code is displayed, click Options, and then select the formatting options that you want.

What does Ctrl Shift F9 do in Word?

To do so, select the entire field or expression and press Ctrl + Shift + F9. Word will remove the field code, leaving only the text. If you want to retain the field code, but prevent automatic updates, lock the field by selecting it and pressing Ctrl + F11.

How do you edit a caption in Word?

Editing Caption Style

  1. Go to the “Styles” section of the “Home” tab and find “Caption”
  2. Right click “Caption” and select “Modify” to open a new window. The “Styles” menu.
  3. Pick the font and formatting options required.
  4. Click “OK” to apply the new style. Modifying the “Caption” style.

Why is F9 not working in Word?

A hardware problem
The past F9 etc troubles usually include suspecting a Windows / Office bug … but it turned out to be the hardware. In one case it was a BIOS setting for the Function keys which reset the Fn keys on startup.Some keyboards have a Function/Fn shift which could be locked on without your knowledge.

How do you update toggle fields in Word?

To update a single field, select it (or click anywhere in it) and press F9, or right-click the field and choose Update Field. If you have toggled on the display of the field code string, updating the field toggles it back to displaying the results.

To update fields in headers, footers or text boxes:

  1. Click in the header, footer or text box.
  2. Pess Ctrl + A to select all.
  3. Press F9.

How do I turn off update fields in Word 2010?

File>Options>Display and uncheck the “Update fields before printing” may do it. Or, it may be necessary to use Ctrl+A (to select everything) and then Ctrl+F11 to Lock the fields, or Ctrl+Shift+F9 to Unlink them. Hope this helps.

What is Shift F7?

Shift+F7: Open the thesaurus. If you have a word selected when you press this combo, Word opens the thesaurus and looks up the selected word.

What is Alt F11?

Ctrl + Alt + F11 sort of puts the GUI to sleep, and puts you into a virtual terminal mode, something like the old fashion ttys. Once in this mode you can choose between 6 different tty input screens. Each acting like it is an old-fashion tty.

What does Alt F4 do in Word?

Alt + F4 is a Windows keyboard shortcut that completely closes the application you’re using. It differs slightly from Ctrl + F4, which closes the current window of the application you’re viewing. Laptop users may need to press the Fn key in addition to Alt + F4 to use this shortcut.

How do I update all figure numbers in Word?

Instead of searching and replacing all the figure numbers in the text, click “Edit” -> “Select All” (or, Ctrl + A), which select the entire document, then, press “F9”. This updates all the figure number automatically.

How do you update cross references in Word?

To update all references in a document, select Edit – Select All (or press Ctrl A), then press F9 or right-click and select Update Field. You can set Word to always update cross-references before printing your document.

How do you reference a caption in Word?

From the References tab, in the Captions group, select Cross-reference . In the Cross-reference dialog box, select the reference type and other options. In the For which caption section, select the item you want to reference and select Insert .

What is F mode key?

The FnLk, F-Lock key is a toggle key on a PC compatible keyboard used to enable or disable the F1 through F12 keys’ secondary functions (hotkeys).Pressing the F-Lock key again toggles off (disables) the F1-F12 key standard functions, and turns on the ability to use the secondary functions on those keys.

How do I unlock my F keys?

For example, on the keyboard below, the Fn Lock key appears as a secondary action on the Esc key. To enable it, we’d hold Fn and press the Esc key. To disable it, we’d hold Fn and press Esc again. It functions as a toggle just like Caps Lock does.

Inserting fields can give you precise control over dynamic text in your document. Fields are an important part of Word, but it’s good to know that many fields are inserted for you through built-in commands and features. For example, fields are at work when you insert page numbers or create a table of contents. In these cases, it’s probably simpler to let Word automatically add them for you. Fields are most useful when you need placeholders for data that might change in your document and for creating form letters or labels in mail-merge documents.

These steps work for inserting any field code in Word. For a list of all field codes with detailed information about each, see List of field codes in Word.

Insert a field

  1. Click where you want to insert a field.

    Tip: If you know the field code for the field that you want to insert, you can type it directly in your document. First press CTRL+F9, and then type the code within the brackets.

  2. Click Insert > Quick Parts > Field.
    Insert Field option on the Quick Parts menu.

  3. In the Field names list, select a field name.

    Tip: You can filter the list by clicking the down arrow in the Categories list.

    Field dialog box

  4. Under Field properties, select any properties or options you want, and click OK.

Notes: 

  • To see the codes for a particular field in the Field box, click Field Codes. For some fields, this button is clicked by default.

  • To nest a field within another field, first insert the outer, or container, field (steps 1-4 above). Then place the insertion point inside the field code where you want to insert the inner field, and repeat steps 2-4 above.

  • If you want to see the codes for a particular field in the Field dialog box, click Field Codes.

  • To nest a field within another field, first insert the outer, or container, field, by using the Field dialog box. In your document, place the insertion point inside the field code where you want to insert the inner field. Then use the Field dialog box to insert the inner field.

If you know the field code for the field that you want to insert, you can also type it directly in your document. First press CTRL+F9, and then type the code within the brackets.

About field codes and syntax

You can insert a field if you want to:

  • Add, subtract, or perform other calculations. To do so, use the = (Formula) field.

  • Work with documents in a mail merge. For example, insert ASK and FILLIN fields to display a prompt as Word merges each data record with the main document.

In other cases, it is simpler to use the commands and options that are provided in Word to add the information that you want. For example, you can insert a hyperlink by using the HYPERLINK field, but it is easier to use the Hyperlink command in the Links group on the Insert tab.

Important: You cannot insert field code brackets by typing the brace characters on the keyboard. To insert field code brackets, press CTRL+F9.

Field code syntax

Field codes appear between curly brackets ( { } ). Fields behave like formulas in Microsoft Office Excel — the field code is like the formula, and the field result is like the value that the formula produces. You can switch between displaying field codes and results in your document by pressing ALT+F9.

When you view a field code in your document, the syntax looks like this:

{ FIELD NAME Properties Optional switches }

  • FIELD NAME     This is the name that appears in the list of field names in the Field dialog box.

  • Properties     These are any instructions or variables that are used in a particular field. Not all fields have parameters, and in some fields, parameters are optional instead of required.

  • Optional switches    These are any optional settings that are available for a particular field. Not all fields have switches available, other than those that govern the formatting of the field results.

For example, you can place the file name and path of your document in the header or footer by inserting the FILENAME field.

The syntax for the FILENAME field code with the path included looks like this:

{ FILENAME p }

Edit a field

  1. Right-click in the field, and then click Edit Field.

  2. Change the field properties and options. For information about the properties and options available for a particular field, see List of field codes in Word or search on the field name in Help.

    Notes: 

    • For some fields, you must display the field code to edit the field. To display all the field codes in the document, press ALT+F9.

    • Some fields are edited in their own dialog boxes instead of in the Field dialog box. For example, if you right-click a hyperlink and then click Edit Hyperlink, the Edit Hyperlink dialog box opens

Display the field results

By default, Word displays the field results seamlessly with the content of your document so that someone reading the document is unaware that part of the content is in a field. However, fields can also be displayed with a shaded background, to make them more visible in the document.

You can make the field results blend into the content of the document by turning off the option to display fields with a shaded background and by formatting the field results, or you can call attention to fields by displaying them with a shaded background, either all the time or only when the field is selected.

You can format the field results by applying text formatting to the field or by adding formatting switches to the field code.

Change the shaded background of fields

  1. Click the File > Options. (In Word 2007, click Microsoft Office Button Office button image , and then click Word Options.)

  2. Click Advanced.

  3. Under Show document content, in the Field shading list, do one of the following:

    • To make fields stand out from the rest of the document content, select Always.

    • To make fields blend in seamlessly with the document content, select Never.

    • To make users of Word aware that they have clicked in a field, select When selected.

      When the field shading option is set to When selected, the field displays a gray background when you click within the field. However, the gray shading does not indicate that the field is selected. When you select the field by double-clicking or dragging the mouse, highlighting that indicates selection is added to the gray shading.

Apply text formatting to a field

  • Select the field that you want to format, and then apply the formatting by using the commands in the Font group on the Home tab.

    For example, to underline the name that is inserted by an AUTHOR field, select the entire field code, including brackets (or select the entire field result), and then click Underline in the Font group on the Home tab.

If you update a field, any formatting that you applied to the field results may be lost. To retain the formatting, include the * MERGEFORMAT switch in the field code. When you insert fields by using the Field dialog box, the * MERGEFORMAT switch is included by default.

Add a formatting switch to a field code

  1. Right-click the field, and then click Edit Field.

  2. Do one of the following:

    • If Field properties and Field options are displayed, select the formatting options that you want.

    • If only the field code is displayed, click Options, and then select the formatting options that you want.

      If the Options button appears dimmed, additional formatting options may not be available.

You can use three formatting switches to format field results:

  • Format switch (*)

  • Numeric format switch (#)

  • Date-Time format switch (@)

Format switch(*)

The Format field switch (*) defines how to display field results. The format instructions determine the following:

  • The use of uppercase and lowercase letters

  • Number formats — for example, whether 9 is displayed as ix (roman numerals) or ninth (ordinal text)

  • character formats

Format switches also retain a field result’s formatting when the field is updated.

Capitalization formats:

The following is a list of switches and the items that they capitalize:

  • * Caps    This switch capitalizes the first letter of each word. For example, { FILLIN «Type your name:» * Caps } displays Luis Alverca even if the name is typed in lowercase letters.

    To select this option in the Field Options dialog box, click Title case.

  • * FirstCap    This switch capitalizes the first letter of the first word. For example, { COMMENTS * FirstCap } displays Weekly report on sales.

    To select this option in the Field Options dialog box, click First capital.

  • * Upper    This switch capitalizes all letters. For example, { QUOTE «word» * Upper } displays WORD.

    To select this option in the Field Options dialog box, click Uppercase.

  • * Lower    This switch capitalizes none of the result; all letters are lowercase. For example, { FILENAME * Lower } displays weekly sales report.doc.

    This switch has no effect if the entire field that contains the switch is formatted as small capital letters.

    To select this option in the Field Options dialog box, click Lowercase.

Number formats:

The following is a list of number switches and their results:

  • *alphabetic    This switch displays results as alphabetic characters. The result has the same case as the word «alphabetic» in the field code. For example, { SEQ appendix * ALPHABETIC } displays B (instead of 2), and { SEQ appendix * alphabetic } displays b.

    To select this option in the Field Options dialog box, click a, b, c,.

  • *Arabic    This switch displays results as Arabic cardinal numerals. For example, { PAGE * Arabic } displays 31.

    Notes: 

    • If the Number format setting in the Page Number Format dialog box is not Arabic, this switch overrides the Number format setting.

    • For page numbers only, there is also an ArabicDash format, which displays results as Arabic cardinal numbers surrounded by hyphen characters. For example, { PAGE * ArabicDash } displays — 31 —.

    To select this option in the Field Options dialog box, click 1, 2, ,3, ….

  • *CardText    This switch displays results as cardinal text. The result is formatted in lowercase letters unless you add a format switch to specify a different capitalization. For example, { = SUM(A1:B2) * CardText } displays seven hundred ninety, and { = SUM(A1:B2) * CardText * Caps } displays Seven Hundred Ninety.

    To select this option in the Field Options dialog box, click One, Two, Three.

  • *DollarText    This switch displays results as cardinal text. Word inserts and at the decimal place and displays the first two decimals (rounded) as Arabic numerators over 100. The result is formatted in lowercase letters unless you add a format switch to specify a different capitalization. For example, { = 9.20 + 5.35 * DollarText * Upper } displays FOURTEEN AND 55/100.

    To select this option in the Field Options dialog box, click Dollar Text.

  • *Hex    This switch displays results as hexadecimal numbers. For example, { QUOTE «458» * Hex } displays 1CA.

    To select this option in the Field Options dialog box, click hex ….

  • *OrdText    This switch displays results as ordinal text. The result is formatted in lowercase letters unless you add a format switch to specify a different capitalization. For example, { DATE @ «d» * OrdText } displays twenty-first, and { DATE @ «d» * OrdText * FirstCap } displays Twenty-first.

    To select this option in the Field Options dialog box, click First, Second, Third, ….

  • *Ordinal    This switch displays results as ordinal Arabic numerals. For example, { DATE @ «d» * Ordinal } displays 30th.

    To select this option in the Field Options dialog box, click 1st, 2nd, 3rd.

  • *roman    This switch displays results as Roman numerals. The result has the same case as the word «roman» in the field code. For example, { SEQ CHAPTER * roman } displays xi, and { SEQ CHAPTER * ROMAN } displays XI.

    To select this option in the Field Options dialog box, click I, II, III,.

Character formats and protecting previously applied formats:

The following are character formatting switches and their results:

  • *Charformat    This switch applies the formatting of the first letter of the field name to the entire result. The result of the following example has bold formatting because the R in REF is bold.

    { REF chapter2_title * Charformat } displays Whales of the Pacific in bold text.

    To add this switch, type it in the field code or in the Field codes box in the Field dialog box.

  • *MERGEFORMAT    This switch applies the formatting of the previous result to the new result. For example, if you select the name displayed by the field { AUTHOR * MERGEFORMAT } and apply bold formatting, Word retains the bold formatting when the field is updated to display a new author name.

    When you insert fields by using the Field dialog box , the *MERGEFORMAT switch is included by default. You can turn this option off by clearing the Preserve formatting during updates check box in the Field dialog box.

Back to formatting switches

Numeric format switch (#)

The Numeric format switch (#) specifies the display of a numeric result.

For example, the switch # $#,##0.00 in { = SUM(ABOVE) # $#,##0.00 } displays a result such as «$4,455.70.» If the result of a field is not a number, this switch has no effect.

Note: Quotation marks are not required around simple numeric formats that do not include spaces — for example, { MarchSales # $#,##0.00 }. For more complex numeric formats and those that include text or spaces, enclose the numeric format in quotation marks, as shown in the following examples. Word adds quotation marks to numeric format switches if you insert a field by using the Field dialog box or the Formula command in the Data group of the Layout tab (Table Tools contextual tab).

Combine the following format items to build a numeric format switch:

  • 0 (zero)    This format item specifies the requisite numeric places to display in the result. If the result does not include a digit in that place, Word displays a 0 (zero). For example, { = 4 + 5 # 00.00 } displays 09.00.

  • #    This format item specifies the requisite numeric places to display in the result. If the result does not include a digit in that place, Word displays a space. For example, { = 9 + 6 # $### } displays $ 15.

  • x    This format item drops digits to the left of the «x» placeholder. If the placeholder is to the right of the decimal point, Word rounds the result to that place. For example:
    { = 111053 + 111439 # x## } displays 492.
    { = 1/8 # 0.00x } displays 0.125.
    { = 3/4 # .x } displays .8.

  • . (decimal point)    This format item determines the decimal point position. For example, { = SUM(ABOVE) # $###.00 } displays $495.47.

    Use the decimal symbol that is specified as part of the regional settings in Control Panel.

  • , (digit grouping symbol)    This format item separates a series of three digits. For example, { = NetProfit # $#,###,### } displays $2,456,800.

    Use the digit grouping symbol that is specified as part of the regional settings in Control Panel.

  • — (minus sign)    This format item adds a minus sign to a negative result or adds a space if the result is positive or 0 (zero). For example, { = 10 — 90 # -## } displays -80.

  • + (plus sign)    This format item adds a plus sign to a positive result, a minus sign to a negative result, or a space if the result is 0 (zero). For example, { = 100 — 90 # +## } displays +10, and { = 90 — 100 # +## } displays -10.

  • %, $, *, and so on    This format item includes the specified character in the result. For example, { = netprofit # «##%» } displays 33%.

  • «example formatting for positive; negative»    This format item specifies different number formats for positive and negative results, separated by a semicolon. For example, if the bookmark Sales95 is a positive value, the field { Sales95 # «$#,##0.00;-$#,##0.00» } displays the value with regular formatting — for example, «$1,245.65». A negative value is displayed with bold formatting and a minus sign — for example, -$ 345.56.

  • «example formatting for positive; negative; zero»    This format item specifies different number formats for a positive result, a negative result, and a 0 (zero) result, separated by semicolons. For example, depending on the value of the Sales95 bookmark, { Sales95 # «$#,##0.00;($#,##0.00);$0» } displays positive, negative, and 0 (zero) values as follows: $1,245.65, ($ 345.56), $0.

  • ‘text’    This format item adds text to the result. Enclose the text in single quotation marks. For example, { = { Price } *8.1% # «$##0.00 ‘is sales tax’ » } displays $347.44 is sales tax.

  • `numbereditem`    This format item displays the number of the preceding item that you numbered by using the Caption command (References tab, Captions group) or by inserting a SEQ field. Enclose the item identifier, such as «table» or «figure,» in grave accents (`). The sequential number is displayed in Arabic numerals. For example, { = SUM(A1:D4) # «##0.00 ‘is the total of Table’ `table`» } displays 456.34 is the total of Table 2.

Back to formatting switches

Date-Time format switch (@)

The Date-Time format switch (@) specifies the display of a date or time.

For example, the switch @ «dddd, MMMM d, yyyy» in the field { DATE @ «dddd, MMMM d, yyyy» } displays «Friday, November 23, 2007.» Combine the following date and time instructions — day (d), month (M), and year (y); hours (h) and minutes (m) — to build a date-time format. You can also include text, punctuation, and spaces.

Date instructions:

Month (M)

The letter M must be uppercase to distinguish months from minutes.

  • M    This format item displays the month as a number without a leading 0 (zero) for single-digit months. For example, July is 7.

  • MM    This format item displays the month as a number with a leading 0 (zero) for single-digit months. For example, July is 07.

  • MMM    This format item displays the month as a three-letter abbreviation. For example, July is Jul.

  • MMMM    This format item displays the month as its full name.

Day (d)

The letter d displays the day of the month or the day of the week. The letter d can be either uppercase or lowercase.

  • d    This format item displays the day of the week or month as a number without a leading 0 (zero) for single-digit days. For example, the sixth day of the month is displayed as 6.

  • dd    This format item displays the day of the week or month as a number with a leading 0 (zero) for single-digit days. For example, the sixth day of the month is displayed as 06.

  • ddd    This format item displays the day of the week or month as a three-letter abbreviation. For example, Tuesday is displayed as Tue.

  • dddd    This format item displays the day of the week as its full name.

Year (y)

The letter y displays the year as two or four digits. The letter y can be either uppercase or lowercase.

  • yy    This format item displays the year as two digits with a leading 0 (zero) for years 01 through 09. For example, 1999 is displayed as 99, and 2006 is displayed as 06.

  • yyyy    This format item displays the year as four digits.

Time instructions:

Hours (h)

A lowercase h bases time on the 12-hour clock. An uppercase H bases time on the 24-hour, or military, clock; for example, 5 P.M. is displayed as 17.

  • h or H    This format item displays the hour without a leading 0 (zero) for single-digit hours. For example, the hour of 9 A.M. is displayed as 9.

  • hh or HH    This format item displays the hour with a leading 0 (zero) for single-digit hours. For example, the hour of 9 A.M. is displayed as 09.

Minutes (m)

The letter m must be lowercase to distinguish minutes from months.

  • m    This format item displays minutes without a leading 0 (zero) for single-digit minutes. For example, { TIME @ «m» } displays 2.

  • mm    This format item displays minutes with a leading 0 (zero) for single-digit minutes. For example, { TIME @ «mm» } displays 02.

Seconds (s)

  • s    This format item displays seconds without a leading 0 (zero) for single-digit seconds. For example { TIME @ «s» displays 5.

  • ss    This format item displays seconds with a leading 0 (zero) for single-digit seconds For example { TIME @ «ss» displays 05.

A.M. and P.M. (AM/PM)

This displays A.M. and P.M. To change the A.M. and P.M. symbols for Microsoft Windows, change the regional settings in Control Panel.

  • am/pm or AM/PM    This format item displays A.M. and P.M. as uppercase. For example, { TIME @ «h AM/PM» } and { TIME @ «h am/pm» } display 9 AM or 5 PM.

Other text and punctuation:

  • ‘text’    This format item displays any specified text in a date or time. Enclose the text in single quotation marks. For example, { TIME @ «HH:mm ‘Greenwich mean time’ » } displays 12:45 Greenwich mean time.

  • character    This format item includes the specified character in a date or time, such as a : (colon), — (hyphen), * (asterisk), or space. For example, { DATE @ «HH:mm MMM-d, ‘yy» } displays 11:15 Nov-6, ’99.

  • `numbereditem`    This format item includes in a date or time the number of the preceding item that you numbered by using the Caption command in the Captions group (References tab), or by inserting a SEQ field. Enclose the item identifier, such as table or figure, in grave accents (`). Word displays the sequential number in Arabic numerals. For example, { PRINTDATE @ «‘Table’ `table` ‘was printed on’ M/d/yy» } displays Table 2 was printed on 9/25/02.

Note: Quotation marks are not required around simple date-time formats that do not include spaces or text — for example, { DATE @ MM/yy }. For more complex date-time formats and those that include spaces or text, enclose the entire date-time format in quotation marks, for example, { DATE @ «dddd MMMM d, yyyy’, at’ h:mm» }. Word adds quotation marks to date-time format switches if you insert a field by using the Date and Time command in the Text group of the Insert tab or the Field dialog box.

Back to formatting switches

Control how fields are updated

By default, Word automatically updates fields when a document is opened. That way, information stays up to date. There are situations where you might not want this to happen, however. For example, you may want the date in the header to reflect a particular date rather than automatically updating to the current date every time the document is opened.

Fields can also be updated by right-clicking a field and then clicking Update Field or by clicking in a field and then pressing F9.

To manually update all the fields in the main body of a document, press CTRL+A, and then press F9. Fields in headers, footers, or text boxes must be updated separately. Click within the header, footer, or text box, press CTRL+A, and then press F9.

You can lock fields to prevent automatic or inadvertent updating of the field.

Lock or unlock a particular field

Do one of the following:

  • To lock a field so that field results are not updated, click the field, and then press CTRL+F11.

  • To unlock a field so that field results can be updated, click the field, and then press CTRL+SHIFT+F11.

Lock results of BOOKMARK, INCLUDETEXT, and REF fields

The Lock Result (!) field switch prevents a field that is included in the result of a BOOKMARK, INCLUDETEXT, or REF field from being updated unless the field result in the original location has changed. Without this switch, Word updates fields that are included in a field result whenever the BOOKMARK, INCLUDETEXT, or REF field is updated.

For example, the field { INCLUDETEXT C:\SalesQtr4 Sales.doc ! } inserts the contents of the document «Qtr4 Sales.doc,» which contains a DATE field and an EMBED field. If you update the INCLUDETEXT field, the ! switch prevents Word from updating the DATE and EMBED fields in the included text unless they are first updated in the original document («Qtr4 Sales.doc»). The switch ensures that the text inserted by the INCLUDETEXT field matches the text in the original document.

To update the DATE and EMBED fields in both locations, update fields in the original document (Qtr4 Sales.doc), and then update the INCLUDETEXT field.

I want a way of updating all fields in a Word 2013 document. (If it works in other versions, all the better; I originally had this problem with Word 2007, and nothing seems to have changed since then.) This includes cross-references, page numbers, tables of contents, indexes, headers, etc. If it can be updated by pressing F9, I want it updated.

(In theory updating fields can cause other fields to need updating, e.g. a longer table of contents changes some page numbers in the main text. Taking care of the common cases is good enough for me. In fact, it’s ok if I have to run the macro two or three times before it stabilizes. I just want to have a single macro that finds everything.)

My attempt so far doesn’t update fields in text boxes inside figures. How do I update them, and what else have I missed?


EDIT: Combining the answer given with what I already had gives a macro that seems to update everything (with a known defect).

'' Update all the fields, indexes, etc. in the specified document.
Sub UpdateAllFieldsIn(doc As Document)
    '' Update tables. We do this first so that they contain all necessary
    '' entries and so extend to their final number of pages.
    Dim toc As TableOfContents
    For Each toc In doc.TablesOfContents
        toc.Update
    Next toc
    Dim tof As TableOfFigures
    For Each tof In doc.TablesOfFigures
        tof.Update
    Next tof
    '' Update fields everywhere. This includes updates of page numbers in
    '' tables (but would not add or remove entries). This also takes care of
    '' all index updates.
    Dim sr As range
    For Each sr In doc.StoryRanges
        sr.Fields.Update
        While Not (sr.NextStoryRange Is Nothing)
            Set sr = sr.NextStoryRange
            '' FIXME: for footnotes, endnotes and comments, I get a pop-up
            '' "Word cannot undo this action. Do you want to continue?"
            sr.Fields.Update
        Wend
    Next sr
End Sub
'' Update all the fields, indexes, etc. in the active document.
'' This is a parameterless subroutine so that it can be used interactively.
Sub UpdateAllFields()
    UpdateAllFieldsIn ActiveDocument
End Sub

How to update all field in Word (Windows and Mac OS)

Table of contents, page number, list of figures/tables/equations, figure/table/equation number and cross reference are some common example of fields. Sometimes you need to update all fields in Ms Word rather than updating each one by one. There are a couple of ways to do it. However, each method has its limitations and doesn’t update each type of field.

This blog describes the correct procedure that ensure every field are updated correctly.

Different ways to update all fields

Method 1: Print preview

Creating print preview updates all field if set correctly. Use print preview shortcut “Control + P” for Windows or “Command + P” for MacOS. Then press esc to move out of it.

Note: This method updates most of the fields including the ones in header and footer.

Before using this method, you need make sure that update field setting in print option is enabled.

Steps to enable “Update Field”

  1. Go to Word Options using Files > Options (Windows) or Word> Preferences (MacOS). You can also use MacOS shortcut Command + ,.
  2. Go to Display Tab > Printing Options Group (Windows) or Print (MacOS) and check box against “Update field before printing” or “Update field”

How to update all fields before printing in Word for Windows

Update all fields before printing in Word for Windows
Update all fields before printing in Word for MacOS
Update all fields before printing in Word for MacOS

Limitations of print preview method

Print preview method doesn’t update fields like table of contents and list of figures/tables/equations which need additional user input before updating.

Method 2: Select All and Update

  1. select all text using “Ctrl +A” and,
  2. press F9 (shortcut to update field)

This method overcomes limitations of the previous method and updates all the fields in selected text including table of contents and list of figures/tables/equations.

Limitations of select all and update method

The fields in header & footer doesn’t get update as their contents are not selected while selecting all text.

Order in which fields get update

Both the method updates fields in the order in which they appear. In other words, the field which appear earlier gets updated earlier. for e.g. if figure is cross referred before it appears (which is more likely) then the cross reference gets updated before the figure number to which it refers. In such case changed figure number doesn’t get reflected in cross reference after first try to update all field.

How to ensure all fields get updated?

How to update all field in Ms Word

To ensure all the fields gets updated to its correct value, first update all fields using “Print preview” method first and then again update all fields using “Select All & Update” method.

Above order ensures that all the fields (like Table of contents, list of figures/tables/equations, figure/table/equation number along with all cross references and fields in header & footer) gets updated properly.

Word supports many different types of fields. A field is a set of codes that instructs Word to automatically insert material into a document. Some of the commonly used fields are PAGE fields that show page numbers and TOC fields that display a table of contents.

In order for fields to show the correct result, they must be updated. Some types of fields are updated automatically by Word whereas other fields must be updated by the user.

In this article, you will find information about how each kind of Word field works in relation to updating. Find out which fields are updated automatically by Word and which fields you must update manually. For each field, you will also find field names and numbers that can be used in VBA if you need to create or edit fields via macros.

Most fields in the header and footer are updated automatically when you open a document.

However, FILENAME fields in the header or footer are not updated automatically when opening a document. According to information in the Microsoft article The FILENAME field does not automatically update when you open a document in Word, this special handling of FILENAME fields was introduced as a design change in Word 2002 to allow documents to open more quickly. It would indeed be an advantage to have FILENAME fields update automatically when opening a document — the speed would most likely not be a problem anymore. You need to update the fields. See How to update fields.

Fields in headers and footers are updated when you switch to Print Preview

When you switch to Print Preview, all fields in the header and footer are updated. This will also trigger FILLIN and ASK fields in the header or footer.

Fields in footnotes, endnotes, text boxes and shapes

As is true for headers and footers, footnotes, endnotes, text boxes and shapes you create using the tools in Insert tab > Illustrations group > Shapes reside in their own layers in a Word document, separated from the main body.

As explained above, fields in headers and footers are updated more automatically than other fields. This automatic control does not apply to fields in footnotes, endnotes, text boxes and shapes. This also means that you may need to manually take care of the field update in those areas of a document. See How to update fields below. 

Note that a text box in Word is actually a shape which means that it acts as other shapes in relation to updating fields.

The easiest way to update all fields in a document with fields spread across several layers is to use a macro. You will find my macro for updating fields here: Macro – Update All Fields in Word Document.

You can read more about the different layers in a Word document later in this article.

Fields in the main body of documents

The rules that apply to how different types of fields update — cold, warm and hot fields

In the table below, all Word fields are listed and organized based on the way they are updated in the main body of documents.

I have used the terms coldwarm, and hot in this relation. Those terms are used in VBA and they can give an indication of how the individual fields work in relation to updating. In the table below, you will find a short description of the characteristics of each of these kinds of fields. For each kind, you will also find a list of all Word fields of that kind.

In the Color code column in the table below, I have assigned a color to each field kind. Those colors are also used in the list of all Word fields sorted alphabetically. The purpose is to make it easier to overview the lists.

In VBA, the wdFieldKind enumeration can be used to return the kind of field. See column 3 in the table below — it shows the wdFieldKind constants and the related numbers. For example, you can return the kind of the first field in the selection using the following VBA code:

The rightmost column lists all fields of each kind.

Kind

Color code

VBA – wdFieldKind

Description – how fields are updated

Fields grouped by kind

Cold

3
wdFieldKindCold

A field that doesn’t have a result.

This also means that a cold field includes nothing to be updated.

PRIVATE
RD
TA
TC
XE

Warm

2
wdFieldKindWarm

A field that has a result and that can be updated.

The group of warm fields include both fields that are automatically updated when the source changes and fields that can be manually updated.

See also “Warm ++” below.

See How to update fields for more details about manually updating fields.

= (FORMULA)
ADDIN
ADDRESSBLOCK
ASK
AUTHOR
AUTOTEXT
AUTOTEXTLIST
BIBLIOGRAPHY
CITATION
COMMENTS
COMPARE
CONTROL
CREATEDATE
DATA
DATABASE
DDE
DDEAUTO
DOCPROPERTY
DOCVARIABLE
EDITTIME
EMBED
FILENAME
FILESIZE
FILLIN
FORMTEXT
GLOSSARY
GREETINGLINE
HYPERLINK
INCLUDE
INCLUDETEXT
INDEX
INFO
KEYWORDS
LASTSAVEDBY
LINK
MERGEFIELD
MERGEREC
MERGESEQ
NEXT
NEXTIF
NUMCHARS
NUMWORDS
QUOTE
REVNUM
SECTION
SET
SKIPIF
SUBJECT
TEMPLATE
TITLE
TOA
TOC
USERADDRESS
USERINITIALS
USERNAME

Warm ++

2
wdFieldKindWarm

The term “Warm ++” is invented here for descriptive purposes.

The description of Warm above applies but, in addition, these fields can be updated in one more way: Most of these fields are related to pagination and printing of documents.

These fields can be updated by switching to Print Preview because this triggers repagination of the document. This is the case no matter whether the option File > Options > Display > Printing options group > Update fields before printing is ON or OFF.

Printing a document or opening a document in Print Layout view will also cause these fields to update.

DATE
FTNREF
IF
NOTEREF
NUMPAGES
PAGE
PAGEREF
PRINTDATE
REF
SAVEDATE
SECTIONPAGES
SEQ
STYLEREF
TIME

Hot

1
wdFieldKindHot

A field that is automatically updated each time it is displayed or each time the page is reformatted.

These fields can also be updated manually. See How to update fields for more details about manually updating fields.

Note that you must save the document to retain the results of automatically updated fields.

ADVANCE
AUTONUM
AUTONUMLGL
AUTONUMOUT
BARCODE
BIDIOUTLINE
EQ
FORMCHECKBOX
FORMDROPDOWN
GOTOBUTTON
IMPORT
INCLUDEPICTURE
LISTNUM
MACROBUTTON
PRINT
SHAPE
SYMBOL

None

0
wdFieldKindNone

An invalid field such as an empty field. If you create fields manually, you can start with an empty field. Examples of invalid fields:
{ }
{ 123 }

See How to create fields manually.

(Empty field)

All Word fields sorted alphabetically — incl. VBA references

Below, you will find a list of all the different Word fields. For each field type, you will find the following information:

  • Field name — shows the field name as it appears when viewing field codes.
  • Kind — shows whether the field is Cold, Warm, Warm ++, Hot or None. See the color codes introduced above.
  • # and VBA wdFieldType Enumeration — show the number and the corresponding constant that can be used in VBA for the field in question.
  • Comment — shows special information about some fields.

Field name

Kind

#

VBA wdFieldType

Comment

Warm

82

wdFieldSubscriber

Subscriber field (I have not found any information about that field).

91

wdFieldHTMLActiveX

Not currently supported.

(Empty field
no name)

None

-1

wdFieldEmpty

Empty field. Acts as a placeholder for field content that has not yet been added.

= (FORMULA)

Warm

34

wdFieldExpression

 

ADDIN

Warm

81

wdFieldAddin

Not available through the Field dialog box. Used to store data that is hidden from the user interface.

ADDRESSBLOCK

Warm

93

wdFieldAddressBlock

ADVANCE

Hot

84

wdFieldAdvance

ASK

Warm

38

wdFieldAsk

AUTHOR

Warm

17

wdFieldAuthor

AUTONUM

Hot

54

wdFieldAutoNum

AUTONUMLGL

Hot

53

wdFieldAutoNumLegal

AUTONUMOUT

Hot

52

wdFieldAutoNumOutline

AUTOTEXT

Warm

79

wdFieldAutoText

AUTOTEXTLIST

Warm

89

wdFieldAutoTextList

BARCODE

Hot

63

wdFieldBarCode

BIBLIOGRAPHY

Warm

97

wdFieldBibliography

BIDIOUTLINE

Hot

92

wdFieldBidiOutline

 

CITATION

Warm

96

wdFieldCitation

COMMENTS

Warm

19

wdFieldComments

COMPARE

Warm

80

wdFieldCompare

CONTROL

Warm

87

wdFieldOCX

OCX field. Cannot be added through the Field dialog box but can be added via code by using the AddOLEControl method of the FormFields collection.

CREATEDATE

Warm

21

wdFieldCreateDate

DATA

Warm

40

wdFieldData

DATABASE

Warm

78

wdFieldDatabase

DATE

Warm ++

31

wdFieldDate

DDE

Warm

45

wdFieldDDE

No longer available through the Field dialog box but supported for documents created in earlier versions of Word.

DDEAUTO

Warm

46

wdFieldDDEAuto

No longer available through the Field dialog box but supported for documents created in earlier versions of Word.

DOCPROPERTY

Warm

85

wdFieldDocProperty

DOCVARIABLE

Warm

64

wdFieldDocVariable

EDITTIME

Warm

25

wdFieldEditTime

EMBED

Warm

58

wdFieldEmbed

 

EQ

Hot

49

wdFieldFormula

 

FILENAME

Warm

29

wdFieldFileName

FILESIZE

Warm

69

wdFieldFileSize

FILLIN

Warm

39

wdFieldFillIn

FORMCHECKBOX

Hot

71

wdFieldFormCheckBox

Inserted via Developer tab > Controls group > Legacy Tools > Check Box Form Field button or via code.

FORMDROPDOWN

Hot

83

wdFieldFormDropDown

Inserted via Developer tab > Controls group > Legacy Tools > Drop-Down Form Field button or via code.

FORMTEXT

Warm

70

wdFieldFormTextInput

Inserted via Developer tab > Controls group > Legacy Tools > Text Form Field button or via code.

FTNREF

Warm ++

5

wdFieldFootnoteRef

Not available through the Field dialog box. Inserted programmatically or interactively.

GLOSSARY

Warm

47

wdFieldGlossary

No longer supported in Word.

GOTOBUTTON

Hot

50

wdFieldGoToButton

GREETINGLINE

Warm

94

wdFieldGreetingLine

HYPERLINK

Warm

88

wdFieldHyperlink

IF

Warm ++

7

wdFieldIf

IMPORT

Hot

55

wdFieldImport

Cannot be added through the Field dialog box but can be added interactively or via code.

INCLUDE

Warm

36

wdFieldInclude

Cannot be added through the Field dialog box but can be added interactively or via code.

INCLUDEPICTURE

Hot

67

wdFieldIncludePicture

INCLUDETEXT

Warm

68

wdFieldIncludeText

INDEX

Warm

8

wdFieldIndex

INFO

Warm

14

wdFieldInfo

KEYWORDS

Warm

18

wdFieldKeyWord

LASTSAVEDBY

Warm

20

wdFieldLastSavedBy

LINK

Warm

56

wdFieldLink

LISTNUM

Hot

90

wdFieldListNum

MACROBUTTON

Hot

51

wdFieldMacroButton

MERGEFIELD

Warm

59

wdFieldMergeField

MERGEREC

Warm

44

wdFieldMergeRec

MERGESEQ

Warm

75

wdFieldMergeSeq

NEXT

Warm

41

wdFieldNext

NEXTIF

Warm

42

wdFieldNextIf

NOTEREF

Warm ++

72

wdFieldNoteRef

NUMCHARS

Warm

28

wdFieldNumChars

NUMPAGES

Warm ++

26

wdFieldNumPages

NUMWORDS

Warm

27

wdFieldNumWords

PAGE

Warm ++

33

wdFieldPage

PAGEREF

Warm ++

37

wdFieldPageRef

PRINT

Hot

48

wdFieldPrint

PRINTDATE

Warm ++

23

wdFieldPrintDate

PRIVATE

Cold

77

wdFieldPrivate

QUOTE

Warm

35

wdFieldQuote

RD

Cold

11

wdFieldRefDoc

REF

Warm ++

3

wdFieldRef

REVNUM

Warm

24

wdFieldRevisionNum

SAVEDATE

Warm ++

22

wdFieldSaveDate

SECTION

Warm

65

wdFieldSection

SECTIONPAGES

Warm ++

66

wdFieldSectionPages

SEQ

Warm ++

12

wdFieldSequence

SET

Warm

6

wdFieldSet

SHAPE

Hot

95

wdFieldShape

SKIPIF

Warm

43

wdFieldSkipIf

STYLEREF

Warm ++

10

wdFieldStyleRef

SUBJECT

Warm

16

wdFieldSubject

SYMBOL

Hot

57

wdFieldSymbol

TA

Cold

74

wdFieldTOAEntry

Table of Authorities Entry field.

TC

Cold

9

wdFieldTOCEntry

Table of Contents Entry field.

TEMPLATE

Warm

30

wdFieldTemplate

TIME

Warm ++

32

wdFieldTime

TITLE

Warm

15

wdFieldTitle

TOA

Warm

73

wdFieldTOA

Table of Authorities field.

TOC

Warm

13

wdFieldTOC

Table of Contents field.

USERADDRESS

Warm

62

wdFieldUserAddress

USERINITIALS

Warm

61

wdFieldUserInitials

USERNAME

Warm

60

wdFieldUserName

XE

Cold

4

wdFieldIndexEntry

Index Entry field.

How to create fields manually

A field added by pressing Ctrl+F9 in a Word document is an Empty field (wdFieldEmpty = -1, field kind None).

Instead of inserting fields via Insert tab > Quick Parts > Fields, you can create fields manually in Word:

  1. Press Ctrl+F9 to add an empty field.
  2. Type the relevant field code between the field brackets.

    See the Microsoft article List of field codes in Word for information about the individual types of Word fields and their syntax.

  3. Press F9 to update the new field.

If you know the syntax of the field you want to insert, the manual method is often the most efficient.

The kind of field will change from None / wdFieldKindNone to one of the other types once you add valid field code.

Field names are not case-sensitive

If you check the field codes of fields that are inserted in Word via the Fields dialog box (Insert tab > Quick Parts > Fields) or by using another command that results in a field being inserted (cross-reference, caption, date, etc.), you will see that Word will use UPPERCASE for the field name. Examples:

{ PAGE }
{ REF _Ref517270969 h }
{ TOC o «1-3» h z u }

Field names are not case-sensitive. For example, a PAGE field will work no matter whether the type is written as PAGE, Page, page, pAge or any other combination of uppercase and lowercase.

Why does Word not update all fields when I select all and press F9 to update fields?

A fast method to update fields in Word is to press Ctrl+A to select all and then press F9 to update fields. However, you may have experienced that this will not catch and update all fields. If the selection is in the main body of the document, Word only updates fields in that area of the document. It may not even update all fields there. If fields are found in text boxes or other shapes in the main body of the document, those fields will not be updated. Read on to find out why.

Content in a Word document is placed in different layers – called stories in VBA

Content in Word is placed in different layers, referred to as stories in VBA. Word can only «see» the content in one layer at a time. If your selection is in the main story, the content in e.g. headers and footers is not currently «visible» to Word. Also, shapes (text boxes, circles, rectangles, etc.) in the main body of the document are not in the text layer but in the drawing layer.

There are several different layers, or stories, in a Word document, actually a total of 17 different types as you will see below. There may not be content in every layer, though.

Principles for getting access to the different stories in VBA

Each story in a Word document may contain objects belonging to other stories. Therefore, you may need to access the objects like opening a Chinese box.

Example: In order to update fields in shapes in the headers of a Word document in VBA, you first need to access the correct type of header. There are, as you may know and as you can also see in the overview of story types below, not only one header story but three: even pages, first page and all other pages. Even pages headers are only visible in a Word document if Page Setup > Layout tab > Different odd and even is turned on in the section in question. Correspondingly, first page headers are only visible in sections that have Page Setup > Layout tab > Different first page turned on.

Shapes – drawing objects – that can include text can also include fields

All shapes that can include text can also include fields – and as fields elsewhere in a Word document, fields in shapes also need to be updated. Therefore, it is useful to understand how Word treats shapes like text boxes, circles, rectangles and other drawing objects with text.

If you right-click a shape that does not have any text, you should see the Add Text command in the context menu if the type of shape can include text.

Shapes can only be inserted in certain parts of a document

If you try to insert a text box or another shape in e.g. a footnote, Word will show the warning in Figure 2 below.

List of objects into which you can’t insert a drawing object

  • Text box
  • Callout
  • Comment
  • Footnote
  • Endnote

Message – you can't put drawing objects in all areas of a Word document.

Figure 2. Message – you can’t put drawing objects in all areas of a Word document.

Overview of layers in a Word document – story types in VBA

As explained above, the content in a Word document is spread across a number of layers, called stories in VBA.

The table below lists the names and numbers of the different story types in VBA. The rightmost column includes information about how the story is related to the content in the Word document.

All the story type are members of the WdStoryType collection.

WdStoryType

Constant name

WdStoryType

Enumeration

Where is the story in the document

wdMainTextStory

1

The main text in the document

wdEvenPagesHeaderStory

6

Text in even pages headers

wdFirstPageHeaderStory

10

Text in first page headers

wdPrimaryHeaderStory

7

Text in all other headers

wdEvenPagesFooterStory

8

Text in even pages footers

wdFirstPageFooterStory

11

Text in first page footers

wdPrimaryFooterStory

9

Text in all other footers

wdFootnotesStory

2

Text in footnotes

wdFootnoteSeparatorStory

12

Text in the layer with the footnote separator

wdFootnoteContinuationSeparatorStory

13

Text in the layer with footnote continuation separator

wdFootnoteContinuationNoticeStory

14

Text in the layer with footnote continuation notice

wdEndnotesStory

3

Text in endnotes

wdEndnoteSeparatorStory

15

Text in the layer with the endnote separator

wdEndnoteContinuationSeparatorStory

16

Text in the layer with endnote continuation separator

wdEndnoteContinuationNoticeStory

17

Text in the layer with endnote continuation notice

wdCommentsStory

4

Text in comments

wdTextFrameStory

5

Text in text boxes and other shapes

How to update fields

Hot fields are updated automatically by Word as described above.

Some warm fields are updated automatically when the source changes. Warm fields that are not updated automatically by Word can be updated manually. You can use different methods as described below.

METHOD 1 — Select the field and update it

  1. Select the field you want to update.
    If you want to update all fields in the current part of the document, press Ctrl+A to select all.
  2. Press F9 to update all fields in the selection.
    Alternatively, right-click and select Update Field from the context menu.

    If the selection includes one or more TOC fields, you will be asked once per TOC how you want the table of contents to be updated.

Note that this method only works in the area of the document where the selection is. If there are fields in e.g. footnotes or endnotes, you need to select those areas individually and update fields.

TIP: If you experience that one or more cross-reference fields do not update as expected, see the article Cross-reference Problems — Troubleshooting.

METHOD 2 — Switch to Print Preview

As mentioned in the description of Warm ++ fields, they can be updated by switching to Print Preview. This method is not sufficient if other kinds of fields need to be updated.

  1. To quickly switch to Print Preview, press Alt+Ctrl+I.
  2. To quickly return to the previous view type, press Esc.

METHOD 3 – Use a macro to update all fields in the entire document

You can update all fields anywhere in the document in one operation using a macro made for that purpose. This is most often the smartest method, at least in documents where fields may be spread across many layers in the document. If you make an update field macro available via the Quick Access Toolbar (QAT) or a keyboard shortcut, it takes only a single click to update all fields in the entire document.

Update All Fields macro — ready for use

I have created a ready-for-use macro that updates all fields in the document no matter where they are found. You can get the Update Fields macro here.

How to make sure all fields are updated when printing

If you turn ON the option Update fields before printing, all fields in the document will be updated when you print. See the illustration below.

If the option Update fields before printing is turned OFF, only field in headers and footers and the fields listed in the warm ++ group will be updated when printing.

Note that this option is a global Word option that applies to the individual user’s Word. It is not stored in the individual document. This means that you cannot rely on all users having this option set the same way unless it is managed by e.g. macros or Group Policy. 

Update fields in Word - make sure fields are updated when printing

How to stop updating fields before printing

In general, a document you print should reflect the actual content of the document. This also means that you would most often want fields to be updated when printing. There may, however, be situations where you want to print a document without fields being updated.

METHOD 1: To prevent Word from updating fields when printing, you can temporarily turn OFF the option File > Options > Display > Printing options group > Update fields before printing (see (3) in the illustration above).

METHOD 2: You can lock the fields as explained below and thereby prevent them from being updated.  

IMPORTANT NOTE: If your reason for wanting to prevent update of fields when printing is that you often see wrong data in a document when fields have been updated, you should rather check those fields. Maybe they are not set up correctly for the purpose. I have seen examples where more or less random fields had been copied from other documents without the user updating them in the new document. The fields were indeed wrong in the context. When the fields were updated during print, they revealed undesired field results. Instead of fixing the fields, the user wanted to prevent them from being updated when printing. Instead, the problem should be solved by correcting the fields.

How to prevent fields from being updated – locked fields

There may be situations when you want to prevent the result of a field from being updated. You can obtain this by locking the field. Locked fields will not change even if you update fields:

  • Press Ctrl+F11 to lock selected fields
  • Press Ctrl+Shift+F11 to unlock selected fields

Another way of retaining the current field result is to convert the field to normal text. If you are sure you will never want a specific field to update, you can convert the field to normal text by pressing Ctrl+Shift+F9.

Locking fields within INCLUDETEXT fields by using the ! switch

Fields of the type INCLUDETEXT inserts the text and graphics contained in the document specified in the field code. You can insert the entire document or a bookmarked portion of the document.

The content inserted as the field result of an INCLUDETEXT field may include other fields. For example, cross-reference fields and other types of fields could be found.

You can add the ! switch to the INCLUDETEXT field code to prevent Word from updating fields in the inserted text unless the fields are first updated in the source document.

Example of using the ! switch

A field with the following field code will insert the content from the document «My Document.docx»:

{ INCLUDETEXT «C:\Users\MyName\Documents\My Document.docx» }

Note the double backslashes, \, instead of single backslashes, , in the file path.

If the inserted content includes fields, those fields will be updated when the INCLUDETEXT field is updated in the target document. That is the default behavior.

Let’s say a cross-reference field in the source document shows «My heading text». However, the heading it points to has been changed to «My new heading text» without updating the cross-reference field. The result in the INCLUDETEXT field will show «My new heading text» when you update the INCLUDETEXT field because that also updates fields within the field result.

You can prevent such fields inside the content from being updated if you add the ! switch (backslash + exclamation mark) to the INCLUDETEXT field as shown below:

{ INCLUDETEXT «C:\Users\MyName\Documents\My Document.docx» ! }

In other words, the ! switch added to an INCLUDETEXT field will make sure that fields inside the inserted content show the same values as in the source document, no matter whether the fields in the source document are updated. If you update the fields in the source document and then update the INCLUDETEXT field in the target document, the fields in the inserted content will be updated.

TIP: If you select IncludeText as the field name in the Field dialog box, turning on Prevent fields from being updated will add the ! switch.

Related information

You can get my Update All Fields macro here.

See the Microsoft article List of field codes in Word for information about the individual types of Word fields, their syntax and how to use them.

The Microsoft support article Some fields are updated while other fields are not lists fields that are updated automatically or updated e.g. when selecting Print Preview. However, the lists don’t seem to be complete according to my experiments. In the lists above, you will see that more fields are listed in those categories than in the Microsoft article.

By default, Word has a number of keyboards shortcuts related to fields. Knowing those shortcuts can save you a lot of time. See my article about useful shortcuts related to fields.

For details about cross-reference fields, see my article How cross-reference fields in Word work on my website wordaddins.com.

In case of problems with cross-reference fields not being updated as expected, see my article Cross-reference Problems — Troubleshooting.

Image of Susan Harkins

on

September 8, 2021, 8:17 AM PDT

3 ways to enter fields in Microsoft Word

Microsoft Word fields house instructions that help you create dynamic content; they’re flexible and powerful, if you know how to use them.


We may be compensated by vendors who appear on this page through methods such as affiliate links or sponsored partnerships. This may influence how and where their products appear on our site, but vendors cannot pay to influence the content of our reviews. For more info, visit our Terms of Use page.

Image: BigTunaOnline/Shutterstock

Occasionally, a requirement simply can’t be easily met with the built-in features. Microsoft Word fields are similar to little bits of code that have a specific job. They return values that you can’t easily do in Word any other way. Fortunately, they’re easy to use once you get the hang of entering them properly. In this article, I’ll show you three ways to enter a Word field:

  • Use the interface
  • Ctrl + F9
  • Type and convert

I’m using Microsoft 365 on a Windows 10 64-bit system, but you can use earlier versions. Word fields aren’t supported by Word Online; the original values will display, but they won’t update, nor can you enter them.

SEE: 83 Excel tips every user should master (TechRepublic)

About Word fields

You can insert fields to display content that will change when you update those fields. You might not realize it, but you’re already using fields. Page numbers, merge fields and so on are inserted automatically when you use those features.

You’ll notice as you work your way through the quick examples, that the function key, F9, plays a big part when working with fields. Specifically, here’s what this key does:

  • Ctrl + F9 enters a blank field.
  • Alt + F9 toggles all the fields in the document.
  • Shift + F9 toggles the selected field.

In addition to entering and toggling fields, you can modify them using switches. A switch is an additional bit of information; it always starts with a backslash (). Switches add formats and change the field’s behavior a bit. We won’t include switches in this article, but you’ll want to explore them later.

When you enter a field, the underlying field code will use the following syntax:

{ FIELD NAME Properties Optional switches }

See Table A for an explanation of these elements.

Table A

FIELD TYPE This is the name of the code and determines what the field does. You’ll often see this part in all uppercase letters, but it isn’t case sensitive.
Properties Optional instructions, but not all fields have them. In the interface dialog that you’ll see in the next section, these are referred to as Field Properties.
Switches These are specific instructions, often to do with formatting that you can enable or disable. The character always denotes a switch.

When including fields in a document, remember that anyone viewing the document in Word can view the underlying codes, so be careful about including personal or confidential information. I’ve never run into this situation but it’s worth noting.

Now that you have a good feel for what fields are, let’s start inserting them. We’ll begin with the interface method.

How to insert a Word field using the interface

Word’s interface provides the most comprehensive method for inserting fields. Even if you find another method easier, I encourage you to review the interface so you can learn what fields are available and about their switches.

SEE: Windows 10: Lists of vocal commands for speech recognition and dictation (free PDF) (TechRepublic)

To enter a field using the interface, do the following:

  1. Position the cursor where you want to insert the field, which can be in the document body, or the header or footer.
  2. Click the Insert tab and then click the Quick Parts dropdown in the Text group.
  3. From the dropdown, choose Fields (Figure A).
  4. The resulting dialog lists the Word fields in the Field Names list, which you can filter using the Categories list. For this simple example, select Author and then select First Capital in the Format list as shown in Figure B.
  5. Click OK, and you’ll see the author’s name in the document (Figure C).

Figure A

Figure B

Figure C

You may have noticed a few other options in the dialog:

  • Field Codes will display the underlying field code.
  • Options will display formatting options and other specialized options that are specific to the field.
  • Preserve Formatting During Updates does just what it says: it preserves formatting.

You’ll want to explore the list of fields and their many options when you have more time.

You can use the interface to nest fields. After choosing one field, move the cursor inside that field and then return to the list and choose the second field. This capability takes a bit of practice. In fact, many users find it easier to enter a nested field manually.

How to insert a Word field by typing and converting

Perhaps the easiest method to enter any field is to simply type it, select it and then press Ctrl + F9. Doing so converts the text to the field(s). Let’s try this with again, the Author field:

  1. Position the cursor where you want to insert the field.
  2. Type Author
  3. Select the text you just typed (Figure D).
  4. Press Ctrl + F9 to convert the string into a true field. As you can see, Word adds the brackets.
  5. To display the field value instead of the field, press F9.

Figure D

This is a quick and easy way to enter a single field when you know the field code and any switches you might want to include. You can also use this method to insert a nested field, but you must insert each individually. You can’t type out an entire string and convert all the fields at once.

How to insert a Word field by using Ctrl + F9

The third method is similar to the previous method. Press Ctrl + F9 to insert a pair of empty brackets and then type the field code and any switches. Let’s try this method with the same { Author } field:

  1. Position the cursor where you want to insert the field.
  2. Press Ctrl + F9 to enter a blank field, as shown in Figure E.
  3. Enter the field code Author inside the brackets and press F9 to calculate the result.

Figure E

Word displays a field’s results rather than the field code, by default. Right-clicking serves as a toggle to display the underlying field code instead of its result. Doing so converts only the one field, so this is an easy way to quickly edit only one field.

For a full list of field codes, visit List of field codes in Word.

Also See

  • How to make fewer mistakes and work more efficiently using predictive text in Microsoft 365
    (TechRepublic)

  • How to use the many text wrapping options in Microsoft Word
    (TechRepublic)

  • Microsoft 365: A cheat sheet
    (TechRepublic)

  • Zoom vs. Microsoft Teams, Google Meet, Cisco WebEx and Skype: Choosing the right video-conferencing apps for you (free PDF)
    (TechRepublic)

  • Checklist: Securing Windows 10 systems
    (TechRepublic Premium)

  • Must-read coverage: Windows 10
    (TechRepublic on Flipboard)

  • Microsoft

  • Software

Понравилась статья? Поделить с друзьями:
  • Word eats my letters
  • Word eating my words
  • Word eating my letters
  • Word eating in french
  • Word eat in italian