Microsoft Office Forums VBA protect header and using formfields

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2019, 03:00 AM
lerxx lerxx is offline VBA protect header and using formfields Windows 10 VBA protect header and using formfields Office 2013
Novice
VBA protect header and using formfields
 
Join Date: Oct 2019
Posts: 1
lerxx is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 10-09-2019, 10:53 PM
gmayor's Avatar
gmayor gmayor is online now VBA protect header and using formfields Windows 10 VBA protect header and using formfields Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,996
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes


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
VBA protect header and using formfields Mailmerge and Formfields Liosis Mail Merge 4 03-07-2014 12:56 PM
VBA protect header and using formfields Protect header/ footer czsti Word VBA 1 08-14-2013 10:49 AM


All times are GMT -7. The time now is 11:34 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft