ProtectedForForms

S

Senad Isanovic

I recorded this code. Need to protect different sections in the document.
But when I run this code nothing heppens. Something is missing... Thanks for
any help,

ActiveDocument.Sections(1).ProtectedForForms = False
ActiveDocument.Sections(2).ProtectedForForms = True
 
C

Chuck

I think you'll find that the code has set the protection for section 2 (Tools
Protect Document... > Forms: >Sections...).

You need to protect the document in order to see the protection at work:

ActiveDocument.Protect _
Password:="", _
NoReset:=False, _
Type:=wdAllowOnlyFormFields

Set the password to whatever you want (or nothing, or prompt the user for a
password). Change NoReset to True if you don't want existing form field
contents to be erased on protect.
 

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