Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Life after Document_Close event 1

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
Hello everyone,

I have some clean up code in my Document_Close() procedure. My problem is that Word shows a dialogbox asking the user "Do you want to save changes to the document" AFTER this Document_Close event, and this dialogbox has a "Cancel" option in it.

If user Cancels the dialogbox, the closing of the document is cancelled. But my clean up code has already run, and my document is no longer in usable condition.

How can I prevent this situation from occurring?

Any thoughts/pointers/advice?

TIA,
Sheila
 

One solution may be:
Code:
DisplayAlerts = False
at the beginning of your _Close event. This way you will not get any messages.

Would that help?

Have fun.

---- Andy
 
Thanks, Andy. That will work for me.. because the site to which users save the document asks the user if they wish to save the changes or not, and that 'alert' thrown by Word is unnecessary in this case.

Thank you very much.
Sheila
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top