macro to close document if macros disabled

C

cmledbetter

I have several users forms that have code to protect the form and alter
behavior of enter key. When opening security settings request user to enable
or disable macros. Sometimes new users disables macros this becomes
problematic since the macros are in place to provide form protection and
cursor control.

Is there code that would force the document to close if macros are disabled?

Any advice appreciated.
 
J

Jay Freedman

No, there is not (and could not be) such code, because it could never run if
macros are disabled.

The best you can do is to completely disable any editing of the document
unless the AutoOpen macro is allowed to run and turn off the protection. You
can also put a big red box at the top of the first page of the document,
explaining that the user must close the document and reopen it with macros
enabled; and the AutoOpen macro (if it runs) can hide that box.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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