Thread: [Solved] Update TOC
View Single Post
 
Old 08-01-2012, 09:47 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,381
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

You could either:
• create a FilePrint sub (which intercepts the File|Print command) to update the fields before opening the Print dialogue; or
• use Word's DocumentBeforePrint event to update the fields.
In either case, the macro could call the Document_Open sub, or you could put the code from that into a separate macro (which you could run via Alt-F8) and also call by both the Document_Open sub and whichever of the others you want. For an overview of using Document events, see: http://word.mvps.org/FAQs/MacrosVBA/AppClassEvents.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote