Macros in templates other than document template or normal.dot

J

Jon

I have a document based on some template, e.g. normal.dot. I also
have
another global template loaded, othertemplate.dot.

Is there some way I can have a macro in othertemplate.dot handling
the
closing of the active document, e.g. Document_Close or AutoClose?

Or does the macro have to be in normal.dot, or the document need to be
based
on sometemplate.dot for this to be possible? When i try putting e.g.
AutoClose in othertemplate.dot and close the document, the code inside
the
AutoClose macro seems not to run.

Jon
 
J

Jean-Guy Marcil

Jon was telling us:
Jon nous racontait que :
I have a document based on some template, e.g. normal.dot. I also
have
another global template loaded, othertemplate.dot.

Is there some way I can have a macro in othertemplate.dot handling
the
closing of the active document, e.g. Document_Close or AutoClose?

Or does the macro have to be in normal.dot, or the document need to be
based
on sometemplate.dot for this to be possible? When i try putting e.g.
AutoClose in othertemplate.dot and close the document, the code inside
the
AutoClose macro seems not to run.

Jon

If you want the equivalent of an AutoClose or DocumentClose event fro all
opened documents, you will need an application wide event:
Application.DocumentBeforeClose event For Word 2000 and above).
See:
http://word.mvps.org/faqs/macrosvba/AppClassEvents.htm

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top