The following is an example of an Auto Open macro you can use.
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: Word Tips is your source for cost-effective Microsoft Word training.
(Microsoft Word is the most popular word processing software in the world.) This tip (422) applies to Microsoft Word 97, 2000, 2002, and 2003. I'd put together an Excel tool and linked Word templates a while back to allow exam front covers to be produced that were of the same format and standard regardless of the exam in question.
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 Auto Open or Auto Close macro, depending on whether you want to update the fields when the document opens or closes.
However, in most cases it is easier 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 on the Insert menu. A field behaves like a formula in Excel — the field code is like the formula (which is hidden), and the field result is like the value that the formula produces (which is visible).
You can switch between displaying field codes and results in your document by pressing OPTION F9 .
When you view a field code in your document, the syntax looks like this: .
When you perform a mail merge, fields define where each piece of merged information will go.
You can also use fields to display data that requires updating, such as the current date or the location of the document.
Word automatically inserts fields when you use particular commands, such as when you insert a page number, a document element such as a cover page, or when you create a table of contents.