I’m attempting to make a document read only with the exception of content controls. (There were issues with usability when setting the protection level as Filling in Forms.)
I believe I’m almost there in that the user is able to Edit the content control when it’s generated with text in it. However if there is no text, the placeholder is not editable.
For the text boxes with content, I go to the first tag of the Paragraph that I create to insert the text in and start an editable range, then end it before inserting the structured document tag.
I have not been able to get the empty control with a placeholder editable yet however. I’ve attempted to go to the first child in the structureddocument tag and start the editable range.
I’ve attempted to surround the tag with an editable range.
Inspecting the xml of a word document where I’ve manually set this property I’ve noticed an w:edGrp property on the w:permStart node that is set to everyone. I’m just not sure how in the api to set this.
Below is the xml snippet referred to above:
<w:sdt>
<w:sdtPr>
<w:tag w:val="3148"/>
<w:id w:val="866254499"/>
<w:lock w:val="sdtLocked"/>
<w:placeholder>
<w:docPart w:val="DefaultPlaceholder_22675703"/>
</w:placeholder>
<w:showingPlcHdr/>
<w:text w:multiLine="1"/>
</w:sdtPr>
<w:sdtContent>
<w:permStart w:id="1976569365" w:edGrp="everyone" w:displacedByCustomXml="prev"/>
<w:p w14:paraId="3AD8B720" w14:textId="77777777" w:rsidR="00B94389" w:rsidRDefault="00000000">
<w:r>
<w:rPr>
<w:rStyle w:val="PlaceholderText1"/>
</w:rPr>
<w:t>Click here to enter text.</w:t>
</w:r>
</w:p>
<w:permEnd w:id="1976569365" w:displacedByCustomXml="next"/>
</w:sdtContent>
</w:sdt>