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.