How to update fields in a protected form in Word 2003 and in Word 2002

This article was previously published under Q291474
This article has been archived. It is offered "as is" and will no longer be updated.
For a Microsoft Word 2000 version of this article, see 212356.
For a Microsoft Word 98 Macintosh Edition version of this article, see 187816.
Fields in a document that is protected for forms may not be updated as you fill out the form.

This article describes how these fields can be updated and how to use a macro to automatically insert and update the result of one form field into another area of a form.

Method 1: Use the "Calculate on Exit" Option

In Word, form fields include a Calculate on exit option. When this option is enabled, fields and form fields can be updated in a protected form document.

To enable the Calculate on exit option, follow these steps:
  1. Double-click a form field to display the Form Field Properties dialog box.
  2. Click to select the Calculate on exit check box, and then click OK.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

212244 How to update Text form fields automatically by using the Calculate on exit option in Word 2000 or Word 2002

Method 2: Reference a Form Field Entry Elsewhere in a Document

There may be times that you may want to reference a form field entry elsewhere in a document.

To repeat a form field entry using a reference field, follow these steps:
  1. Position the insertion point where you want the data to be repeated.

    NOTE: The document (or section where the insertion point is) must be unprotected to insert a field.
  2. On the Insert menu, click Field. In the Field names list, click REF.
  3. Under Field properties, in the Bookmark name box, select the form field bookmark name that represents the form field into which you are entering the data. If you see the Advanced field properties option rather than the Field properties option, click Hide Codes.
  4. Click OK.
The REF field must be updated to display and print the text. An update includes all fields such as DATE and TIME. There are two ways to update fields in the protected area of your form: If the form is to be a printed form, you can have the REF fields update when you print the document.

To update fields when printing, follow these steps:

  1. On the Tools menu, click Options.
  2. On the Print tab, click to select the Update Fields check box.
When you select this option, fields may not be updated on the screen, but Word updates them properly when you print the document.

Method 3: Use a Macro

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
For more information about how to use the sample code in this article, click the article number below to view the article in the Microsoft Knowledge Base:
290140 How to run the sample code for the Office XP programs from Knowledge Base articles
If you need all fields to be updated on the screen as you fill out the form, including fields not updated using the Calculate on exit option as described in Method 1, use the following macro as the On exit macro for your form field(s):

NOTE: Running the following macro updates all fields in the entire document, including linked objects (for example, a linked Microsoft Excel spreadsheet).
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 aStoryEnd Sub				
NOTE: Because this exit macro may cause a slight delay on some computers, you may choose to select the Update Fields on printing option if this is to be a printed form. You may also choose to select the Calculate on exit option as described in Method 1.
OfficeKBHowTo forms formfield ref unprotect vba inf
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Article ID: 291474 - Last Review: 12/06/2015 01:12:03 - Revision: 1.0

Microsoft Word 2002

  • kbnosurvey kbarchive kbprogramming kbfield kbforms kbhowto kbmacroexample KB291474