#1
|
|||
|
|||
VBA protect header and using formfields
Hello,
i have protected my header of the document with the following code: ActiveDocument.Sections(1).ProtectedForForms = True ActiveDocument.Sections(2).ProtectedForForms = False ActiveDocument.Protect Type:=wdAllowOnlyFormFields, Password:="password" Now I would like to use "FormFields" in the header but I cant change the value of them. In detail, I would like to use a ContentControlListEntry. Thanks in advance! |
#2
|
||||
|
||||
You shouldn't be using editable fields in the header for the simple reason that the user has to open the header in order to access them. Put them in the body of the document and if you want to repeat them in subsequent page headers, either use mapped content controls or in the case of form fields use REF fields.
You should not mix form fields and content controls in the same document. Physically then can be mixed, but it makes any automated reading and recording the form data subsequently far more difficult than it needs to be - see Extract data from forms If you are using content controls, the document doesn't need to be protected for forms as that imposes all sorts of restrictions. You could instead use 'editors' applied to the controls and apply read only protection. You may find Insert Content Control Add-In useful as a means of inserting controls and applying 'editors' and protection.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I un-protect docs I didn't protect? | doctorduncan | Word | 4 | 05-30-2019 11:09 AM |
How can I replace FormFields with text | Keybraker | Word VBA | 4 | 05-05-2019 08:51 PM |
Issue Using FormFields.Result | boCash | Word VBA | 0 | 04-04-2017 12:54 PM |
Mailmerge and Formfields | Liosis | Mail Merge | 4 | 03-07-2014 12:56 PM |
Protect header/ footer | czsti | Word VBA | 1 | 08-14-2013 10:49 AM |