Stopping AutoClose macro

S

Stephen English

I have put code in the AutoClose macro to check if a bookmark exists. If it
doesn't I throw up an error messagebox. However, when they OK the message
box, I want to cancel the autoclose so the document stays open. Exit Sub
doesn't work.

Any ideas please?
Stephen
 
J

Jezebel

In place of AutoClose, you want the DocumentBeforeClose event. That has a
Cancel argument which, if set TRUE, prevents the document closing.

Read Help on 'Trapping Word events' for how to set it up.
 

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