When you automate a form, text that you type into a Text
form field appears automatically in other locations in the same document. Form
fields in Word include a Calculate on exit option. The
Calculate on exit option is especially useful when you
automate documents and need to update the calculation of Text form fields
automatically or to repeat text that is typed in one form field in other
locations in the same document.
Example 1: Text Form Fields That Perform Calculations
This example creates a new form template that contains two Number
Text form fields and a Calculation form field. When you press the TAB key to
quit either of the first two form fields, the Calculation form field is
automatically updated with the result.
Step 1: Create a New Document with Text Form Fields
To create a new document with Text form fields, follow these
steps:
Create a new document.
On the View menu, point to Toolbars, and then click Forms to display the Forms toolbar.
On the Forms toolbar, click Text Form Field to insert a Text form field, and then press ENTER
twice.
Insert two additional Text form fields in the same way, and
press ENTER twice after you insert each form field.
Double-click the first form field (or right-click the field
and then click Properties on the shortcut menu) to access its options. Set the options to
the following:
Under Type, select Number.
Under Field Settings, select the Calculate on exit check box, and
then click OK.
Repeat step e for the second form field.
Double-click the last form field to access its options. Set
the options to the following:
Under Type, select Calculation.
In the Expression box, type =SUM(Text1,Text2).
NOTE: Text1 and Text2 in this example are the bookmark names for the
first two Text form fields that you inserted in steps c and d. To determine the
correct bookmark name for each Text form field, double-click each form field,
and then view the Text Form Field Options dialog box.
Click OK.
Step 2: Save the Document as a Protected Template
To save and protect your form template, follow these steps:
Protect the template. To do this, click Protect Document on the Tools menu. Under Protect document for, click Forms, and then click OK.
Save the document as a template by clicking Save As on the File menu.
Under Save as type, select Document Template (*.dot), type a name in the File name box, and then
click Save.
On the File menu, click Close to close the template.
Step 3: Test the Template
To test the template, follow these steps:
On the File menu, click New, and then open a document that is based on the newly created
template.
NOTE: In Microsoft Word 2002, click General Templates in the New Document task pane, click to select the template that you created, and
then click OK.
Type a number in the first form field, and then press the
TAB key.
Type a number in the second form field, and then press the
TAB key.
Notice that when you press the TAB key to quit either of the
first two form fields, the Calculation form field is updated
automatically.
Example 2: Text Form Fields That Are Used with Reference (REF) Fields
This example creates a new form template that contains a Text
form field and a Reference (REF) field. When you press ENTER to quit the Text
form field, the text that you typed in the form field is automatically updated
in the Reference (REF) field.
Step 1: Create the Document with the REF Field
To repeat the result of a Text form field in another location,
use a REF field. To do this, follow these steps:
Create a new document.
On the View menu, point to Toolbars, and then click Forms to display the Forms toolbar.
On the Forms toolbar, click Text Form Field to insert a Text form field.
Double-click the form field to access its
options.
Under Field Settings, select the Calculate On Exit check box, and then click OK.
Notice that Word assigns the Text1 bookmark name to
the form field.
Press the RIGHT ARROW key to turn off selection of the form
field.
Press ENTER four times to insert blank lines.
On the Insert menu, click Field. Under Categories, select Links and References. Under Field Names, select Ref.
In the Field codes box, type Text1 so that the result appears
as follows:
REF Text1
NOTE: In Microsoft Word 2002, in the Field dialog box, click Field Codes to access the Field codes box.
NOTE: Text1 is the bookmark name of the form field that you inserted
in step c. The name is case-sensitive.
Click OK.
Step 2: Save the Document as a Protected Template
To save and protect the document, follow these steps:
Protect the template. To do this, click Protect Document on the Tools menu. Under Protect document for, click Forms, and then click OK.
Save the document as a template by clicking Save As on the File menu.
Under Save as type, select
Document Template (*.dot), type a name in the File
name box, and then click Save.
On the File menu, click Close to close the template.
Step 3: Test the Template
To test the template, follow these steps:
On the File menu, click New, and then open a document that is based on the newly created
template.
NOTE: In Microsoft Word 2002, click General Templates in the New Document task pane, click to select the template that you created, and
then click OK.
Type some text in the form field, and then press the TAB
key.
Notice that when you press the TAB key to quit the form field,
the REF field is updated automatically with the same text that you typed into
the form field.