Disable / prevent document close, except through a userform.

D

David Newman

I'm looking to force the user to close the document through a userform,
rather than clicking the 'X'.
There's code out there (MVPs) that disables the 'X' for a userform, through
the API.
I haven't been able to successfully adapt it to the ActiveDocument.
If you have a solution, I thank you kindly!
 
R

Russ

If you are talking about a userform dialog and not a formfield in a
document, then one possibility is to use:
MyUserForm.Show

By itself, which by default doesn't show the form in a modeless mode. If the
form is not modeless, then no other parts of Word can be activated until the
form is closed.

Anyway, earlier versions of VBA can't make a userform modeless. (i.e. Word97
or MacWord)
 

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