I am trying to find a way to capture the events that are launched when the
Close button on the title bar in Word is clicked or the Close option is
selected when using the Control Box for the Word application.
I am trying to do this because I need to control the copying of a logo image
into each header of a document when the user saves, prints, previews or
closes a document based upon a template that I am working with.
I have found ways to capture the various save, print, etc. events from the
File menu and the Standard toolbar buttons and the only events remaining to
be dealt with seem to be when the user clicks on the Close button or uses the
Control Box.
I have also tried defining the Word application as an object within a Class
module and capturing the application quit event but the event does not seem
to be captured when I test the template.
All of my research into this problem in the Microsoft newsgroups so far
suggests that this may not be possible. Any help would be greatly appreciated.
Thank you.
Tony Jollans - 21 Jan 2006 01:30 GMT
Not entirely sure if this is what you want, but ...
Sub DocClose()
Msgbox "Trying to Close Document"
End sub
--
Enjoy,
Tony
> I am trying to find a way to capture the events that are launched when the
> Close button on the title bar in Word is clicked or the Close option is
[quoted text clipped - 17 lines]
>
> Thank you.
Doug Robbins - Word MVP - 21 Jan 2006 07:15 GMT
See the article "A Pseudo DocumentBeforeClose Event" at:
http://www.word.mvps.org/FAQs/MacrosVBA/PseudoBeforeClose.htm

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I am trying to find a way to capture the events that are launched when the
> Close button on the title bar in Word is clicked or the Close option is
[quoted text clipped - 23 lines]
>
> Thank you.
Michael Stauffer - 24 Jan 2006 17:41 GMT
Thank you both for replying.
It looks as if Doug's solution pointed me in the correct direction.
Thanks again.
> See the article "A Pseudo DocumentBeforeClose Event" at:
>
[quoted text clipped - 27 lines]
> >
> > Thank you.