To take advantage of some of the more advanced features of Word, you require the use of fields. Table of contents, cross references, captions, formulas etc. all use fields to provide automation to the document.
When a document changes these fields need to be updated. This can be done by pressing the F9 key, or by right-clicking on the required field and choosing Update Field.
If the document changes regularly, or is large and time consuming to keep track of the many fields used, it could be a good idea to set Word to automatically update the fields on opening the document.
The following post explains how to create a macro that is run on opening a word document. The result is that all document fields are automatically updated upon opening the document.
- Open the document which you wish to add the macro to automatically update fields
- Press Alt+F11 to open the Visual Basic Editor
- On the left you should notice an area called Normal and another with the Project (name of the document)
- Under the heading saying Project (name of the document) and Microsoft Word Objects double click This Document
- At the top of the code module window that appears are 2 lists. Click on the first one and select Document and then select Open from the one on the right
- Enter the text as shown below between the opening and closing Document_Open procedure statements
- Save and close the document
The document will update fields automatically now whenever it is opened. This will save the user a job every time the document is changed, and also improve the accuracy of the file.
Leave a Reply