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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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