Word

Update All Fields

Ease of Use

Easy

Version tested with

2000 

Submitted by:

mdmackillop

Description:

Updates all fields in the active document.. 

Discussion:

If you often work with fields in your documents, and hate having to remember to update them, you can use this little macro to do it for you. Store the code in your normal.dot file so that you can use it on any document, then assign a toolbar button to run it. (No sample file included with this entry.) 

Code:

instructions for use

			

Sub UpdateAll() Dim myRange Set myRange = Selection.Range Selection.WholeStory Selection.Fields.Update myRange.Select End Sub

How to use:

  1. Copy the code above.
  2. Open Word.
  3. Hit Alt+F11 to open the Visual Basic Editor.
  4. On the left, select Normal and hit Insert-Module from the menu.
  5. Paste the code into the module window at the right of the VBE.
  6. Hit the save diskette.
  7. Close the VBE.
 

Test the code:

  1. Insert a new field into any document.
  2. Hit Tools-Macro-Macros and double-click UpdateAll.
 

Sample File:

No Attachment 

Approved by Anne Troy


This entry has been viewed 176 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express