I am manipulating a Word 2010 document on the server-side and some of the content controls in the document have the following Locking properties checked
- Content control cannot be deleted
- Contents cannot be edited
Can anyone advise set these Locking options to false or remove then altogether using the OpenXML SDK?
The openxml SDK provides the
Lockclass and theLockingValuesenumerationfor programmatically setting the options:
So, to set those two options to “false” (
LockingValues.Unlocked),search for all
SdtElementelements in the document and set theValproperty toLockingValues.Unlocked.The code below shows an example: