• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microsoft Excel Tips and Tricks - Computergaga

  • Home
  • Excel Online Courses
  • Excel Functions List
  • Free Downloads
  • Blog
  • Tutorials
  • About
Home / Office / Automatically Update Fields on Opening a Document

Automatically Update Fields on Opening a Document

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.

  1. Open the document which you wish to add the macro to automatically update fields
  2. Press Alt+F11 to open the Visual Basic Editor
  3. On the left you should notice an area called Normal and another with the Project (name of the document)
  4. Under the heading saying Project (name of the document) and Microsoft Word Objects double click This Document
  5. 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
  6. Enter the text as shown below between the opening and closing Document_Open procedure statements

Selection.WholeStory

Selection.Fields.Update

Update fields automatically when opening a document
  1. 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.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • Excel SWITCH Function – Nested IF Function Alternative
  • Sum Formulas Only in Excel
  • How to Calculate Age in Excel
  • Custom Sort in Excel
  • Case Sensitive Lookup with XLOOKUP in Excel
Advanced Excel Success book

Footer

Contact

[email protected]

LinkedIn Twitter YouTube

Useful Links

  • Home
  • Excel Online Courses
  • Tutorials
  • Sitemap
  • Privacy Policy
  • Jobs by Jooble

Course Topics

  • Blog
  • Charts
  • Courses
  • Dashboards
  • Downloads
  • Excel Tips
  • Formulas
  • Mail Merge
  • Office
  • PivotTables
  • Power BI
  • Power Pivot
  • Power Query
  • VBA

Join Our Mailing List

© Copyright 2009 Computergaga · All Rights Reserved ·