I’m trying to update the content of a “Content Control” (StructuredDocumentTag) that I use as placeholder with some multi-line content.
It worked with a very basic sample word document but did not work with my real word document. I receive a ‘System.ArgumentException: Cannot insert a node of this type at this location.’ exception…
I manage to recreate two identical documents, one is working, the other is not (see attached). Do you know what is the problem and how to fix it?
I may be going at this the wrong way, is there a better way to do update a specific region with text… it’s not a mail merge, so I don’t know if Fields can help.
While using the latest version of Aspose.Words i.e. 11.3.0, I managed to reproduce this exception on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-6397. Your request has also been linked to this issue and you will be notified as soon as it is resolved.
Thanks for your request. In this case, I am afraid, I cannot suggest you any programmatic workaround. So, you will have to wait for the fix. We will keep you informed and immediately let you know via this forum thread once this problem is resolved. We apologize for your inconvenience.
I am having the exact same issue. I need to replace existing simple SDT “placeholder” content with either multiline text or a table depending upon program logic. I see code examples for building new SDT content with tables, etc. but not best practice code for navigating to an existing SDT in a document and replacing it with multiline or table content. Or am I missing something? I am still pretty new to the Aspose.Words library.
Thanks for your inquiry. It would be great if you could attach a sample Word document containing the SDT you wanted to replace with multi line text or Table. Also, please attach your target Word document here for testing. We will investigate as to how you are expecting your output document to be generated like and provide you code snippet.