Click on content control selects all data,does not allow to edit

Hi Support team,
Using Aspose.word in C# I am creating a new word document copying content controls from another word document . In the new document when clicks on newly added content control by default all data selecting and does not allow to edit . When I start entering anything then old texts are deleted to add new text . IT is not allowing me to edit .

I have created and attached a sample Console application for your reference .
Please let me know how can I edit post coping a content control from another document
Thanks

@rasmi.mishra,

To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:

  • Your simplified input Word document
  • Aspose.Words 19.4 generated output document showing the undesired behavior
  • Please also create a simplified standalone console application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

P.S. I am afraid, we do not see any attachments in this thread. You can also upload the ZIP file to Dropbox and share the Download link here for testing.

AddContentCotrol.zip (54.2 KB)
Hi ,
I have uploaded sample Console application , last time it was missing I think due to size issue
Please run it and you can find the generated word document in [working directory]/output/
Also I have attached sample output.docx file in zip code for your reference . In this document when you click on any content control , all text will be selected and will not allow to edit , only allow to replace
Let me know if you have any doubt on this
Thanks

@rasmi.mishra,

You can fix the “output.docx” document by using the following code: (see 19.4.zip (10.7 KB))

Document doc = new Document("E:\\AddContentCotrol\\output.docx");

foreach(StructuredDocumentTag sdt in doc.GetChildNodes(NodeType.StructuredDocumentTag, true))
{
    sdt.IsShowingPlaceholderText = false;
}

doc.Save("E:\\AddContentCotrol\\19.4.docx"); 

Hope, this helps.