Hi,
When I tried to replace text inside a content control using .Replace() and I found it doesn’t work.
You can reproduce this issue by using my sample attached and the following code:
var document = new Document(@“test.docx”);
document.Range.Replace(“test”, “replaced”, new FindReplaceOptions());
document.Save(@“output.docx”);
As you can see in output.docx, “test” in the main document and in textbox have been replaced successfully but the one in content control was ignored.
Could you please tell me how to replace text inside a content control?
Thanks
Hi John,
Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for .NET 16.8.0 and have not found the shared issue. Please use Aspose.Words for .NET 16.8.0. We have attached the output document with this post for your kind reference.
Thanks for your reply.
I can see this issue doesn’t happen in Aspose.Words 16.8.0.0 and I was using 16.7.0.0. I didn’t know it as it was not mentioned in the release note but I’m glad this has already been fixed.
Thanks very much
Hi John,
Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.