View Single Post
 
Old 11-09-2012, 02:23 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Assuming the field is in the body of the document, the macro is nothing more than:
Code:
Private Sub Document_Open()
ThisDocument.Fields.Update
End Sub
To install it for use, press Alt-F11 to open Word's vb editor. On the left had side of the screen, you'll see a panel containing your document's name and, below that an entry named 'ThisDocument'. Double-click on 'ThisDocument', then paste the above code into it. Press Alt-F11 again to return to the document, then save it. That's all there is to adding the macro to your document.

And yes, all users would need to have Word configured appropriately. For Word to be able to run macros, go to Word Options|Trust Centre>Trust Center Settings and select the 'Disable all macros with notification' option. That will cause Word to ask for permission before allowing macros in a document to run. This setting applies to all documents, except those opened from what Word 2007 & later call 'trusted publishers, 'trusted locations' and trusted documents' (none of which generate the prompt). The dialoge box that opens when you clicked on 'Trust Center Settings' has entries for these as well, but you probably don't need to worry about any of their settings.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote