Update field macro

G

gdf1903

Hi,

I have found the following macro code that will go through a document
and update all the fields when run.

I woudld like this to run automatically when a document is saved or
closed.

Can anyone help me out with this?

Thanks,

Gary.
 
J

Jay Freedman

You need to call your macro from either an "Auto" macro or an event handler.
It can be difficult to anticipate and catch all the possible ways a document
could be saved or closed, so you have some studying to do.

See http://www.word.mvps.org/FAQs/MacrosVBA/PseudoBeforeClose.htm,
http://www.word.mvps.org/FAQs/MacrosVBA/DocumentEvents.htm and
http://www.word.mvps.org/FAQs/MacrosVBA/ApplicationEvents.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top