How to unlock header content control in form
Hello, everyone. Thanks in advance for your assistance.
I have a multi-page form in Word 2016 which is locked for forms. One of the content control text fields on the cover is for a company's name. I want that name to be inserted into a content control field in the header of the remaining pages. Unfortunately, the code I wrote that worked during the design phase (unlocked doc) DOESN'T work once the document is locked for forms: I get an error message that the content control is locked even though the "Contents cannot be edited" property is successfully unset (unlocked) by the code. If I unlock the document, my code works fine.
My script:
With Doc.SelectContentControlsByTag("PartnerNameHeader" ).Item(1)
.LockContents = False
.Range.Text = _
Doc.SelectContentControlsByTag("PartnerName").Item (1).Range.Text
.LockContents = True
End With
So...why does locking the document for forms have some sort of override that is preventing the content control from being edited even if its field properties says it is editable? How can I overcome this?
Thanks again.
- Nikko
|