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
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.
>I have put code in the AutoClose macro to check if a bookmark exists. If
>it
[quoted text clipped - 5 lines]
> Any ideas please?
> Stephen
Stephen English - 24 May 2006 06:00 GMT
Thank you for such a speedy response. All working now.
Cheers
Stephen
> In place of AutoClose, you want the DocumentBeforeClose event. That has a
> Cancel argument which, if set TRUE, prevents the document closing.
[quoted text clipped - 10 lines]
> > Any ideas please?
> > Stephen