Hi jaslegume
See
Running a macro automatically when a document is created, opened or closed
http://word.mvps.org/FAQs/MacrosVBA/DocumentEvents.htm
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
> How do I get a reference to all of the special sub routine names in
> normal.dot that intercept certain events. A good example is "autoopen".
> When you call a sub autoopen it will intercept all open events no matter
> where the open takes place. For instance it will fire if you go file/open
> and it will fire if you open it from the file explorer tool.
jaslegume - 30 Jul 2007 16:42 GMT
Shauna:
What I am trying to do is to provide code to the normal.dot file so that I
can track the saving of protected templates. This means I need to capture
both the close event and the save event. This should be done globally.
Within the close even I need to track the diaglogue that comes up and ask you
if you want to save the file. On the save event i want to track whether the
file has been changed.
> Hi jaslegume
>
[quoted text clipped - 12 lines]
> > where the open takes place. For instance it will fire if you go file/open
> > and it will fire if you open it from the file explorer tool.
Shauna Kelly - 31 Jul 2007 08:21 GMT
Hi
It's generally considered poor practice to edit users' normal.dot files. The
better solution is to put your code in a .dot file, and put that .dot file
into the Word startup folder. It will then load as an add-in whenever Word
starts.
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
> Shauna:
>
[quoted text clipped - 27 lines]
>> > file/open
>> > and it will fire if you open it from the file explorer tool.