Free Support Forum - aspose.com

How to identify a content control in word document is editable or locked

Hi ,
I need to loop through all the content controls in a word document and check whether content control is editable or locked . How to find this using Aspose in c#
Thanks

@rasmi.mishra

Please use StructuredDocumentTag.LockContents property as shown below to check either user can edit the contents of content control or not.

Document doc = new Document(MyDir + @"in.docx");
foreach (StructuredDocumentTag structuredDocumentTag in doc.GetChildNodes(NodeType.StructuredDocumentTag, true))
{
    if (structuredDocumentTag.LockContents)
        Console.WriteLine("The contents of this StructuredDocumentTag cannot be edited.");
}