Prevent Save and Save as

C

Corey

Is there a line of code to Exit a routine is the user tries to Save ot
Saveas a Document?
If so how?
 
J

Jay Freedman

Is there a line of code to Exit a routine is the user tries to Save ot
Saveas a Document?
If so how?

Well, theoretically...

You can write macros named FileSave, FileSaveAs, and FileSaveAll and put any
code in there you want (or none, so the macro does nothing). These will
intercept the corresponding commands from the menu, shortcuts, or toolbar
buttons (see http://word.mvps.org/faqs/macrosvba/InterceptSavePrint.htm). That
article also mentions a gotcha and a workaround for it.

This approach assumes, though, that the macros aren't prevented from running by
Word's macro security settings, and you cannot control any other user's
settings. It also assumes that the user is willing to put up with your
restrictions -- he or she can prevent your macros from running in several ways.
 

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