Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Where to put a macro that I want to run when Word closes?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen English - 29 Nov 2005 05:09 GMT
I want to run a macro when the user closes Word rather than when they close a
document.  Is there a place to put this please?
Regards
Stephen English
Jezebel - 29 Nov 2005 08:35 GMT
It can go in any loaded template or add-in. If this is purely for your own
use, normal.dot is simplest. If it's for distribution, create an add-in.

>I want to run a macro when the user closes Word rather than when they close
>a
> document.  Is there a place to put this please?
> Regards
> Stephen English
MacroView - 30 Nov 2005 00:03 GMT
Use the AutoExit macro as it runs when Word quits. If its not just for
persoal use then don't store on Normal.dot but on a global template in
your Startup folder.
Jonathan West - 30 Nov 2005 11:17 GMT
> Use the AutoExit macro as it runs when Word quits. If its not just for
> persoal use then don't store on Normal.dot but on a global template in
> your Startup folder.

Be aware that strictly speaking AutoExit is not run when Word closes, it is
run when that template is unloaded.

If the AutoExit is in normal.dot, normal.dot is only ever unloaded
immediately prior to Word closing so this is a distinction is without much
of a practical difference. But for add-ins, the AutoExit macro will run also
if you go to Tools, Templates and add-ins, and uncheck the template in the
addins list.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org 


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.