We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Lock Content Control

Hi Support Team,

I have scenario like below.
Adding Content control to Child document which is then appended to parent document.
After saving the document, locking at content/Control level is not working in final document

sample code :
var parentDocument = new Document(“Path is mentioned here”);
var childDocument = new Document();
var contentControl = new StructuredDocumentTag(childDocument, SdtType.RichText, MarkupLevel.Block);
contentControl.RemoveAllChildren();
var para = new Paragraph(childDocument);
var run = new Run(childDocument) {Text = “Sample Text here”};
para.Runs.Add(run);
contentControl.LockContents = true;
contentControl.LockContentControl = true;
contentControl.ChildNodes.Add(para);
childDocument.FirstSection.Body.AppendChild(contentControl);
parentDocument.AppendDocument(childDocument, ImportFormatMode.KeepSourceFormatting);
// Saving parentDocument

Please correct the code and make me clear on how locking in aspose works.

@crmohan74

Thanks for your inquiry. Please ZIP and attach your input Word document here for testing. We will investigate the issue on our side and provide you more information.