Capturing the Word application quit events

M

Michael Stauffer

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.
 
T

Tony Jollans

Not entirely sure if this is what you want, but ...

Sub DocClose()
Msgbox "Trying to Close Document"
End sub
 
M

Michael Stauffer

Thank you both for replying.

It looks as if Doug's solution pointed me in the correct direction.

Thanks again.
 

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