Intercept ProtectForm event

J

Jay Freedman

I am having difficulty using the great direction found at
("http://word.mvps.org/faqs/macrosvba/InterceptsavePrinContent.htm)
to intercept the ProtectForm command/event.

Using Word 2000, I am unable to get into the sub when I save it in my
Normal.dot. What's the trick? Also, must the sub be kept in the NewMacros
module, or can I move it?

TIA

The trick is that there are two separate commands, each of which has
to be intercepted by a separate macro. One macro must be named
ToolsProtect, and it intercepts the menu item Tools > Protect
Document. The other macro must be named ProtectForm, and it intercepts
the lock button on the Forms toolbar.

The macros can be in any module, in either Normal.dot or a global
add-in template (that is, one stored in Word's Startup folder). The
NewMacros folder is special only in that the macro recorder defaults
there, and creates that module if it doesn't exist. You can remove the
NewMacros module if it's empty or if you don't need any of the code
that's in it.

A little-known trick is that you can direct the recorder to put its
macro into any module. In the box where you put the name of the macro,
type the module name and a dot followed by the macro name. For
instance, to record a ToolsProtect macro directly into a module named
MyTools, type MyTools.ToolsProtect into the box. The module doesn't
even have to exist first.

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

zSplash

Thanks so much for the expert advice, Jay. It works just fine now.
(I shoulda been able to figure it out. Rats!)

st.
 

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