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

Free Support Forum - aspose.com

Inserting formatted Text (merging documents)


I am trying to convert our Office Automation application to Aspose (Words for .Net), and run into the functionality where we used to inject formatted text from one document into another at the place of a Mergefield. (via Range.FormattedText)

As Aspose Words does not have such a property (as it is node based) I tried to copy over Nodes from the source document. However, I run into the error that the node types I try insert are not allowed at that location. (the mergefield can be in the middle of a paragraph, or more commonly, in a cell in a table.)

I noticed an old post that seems to refer to what I need, but it contained a dead link:

So, can you please inform me how I can copy over the formatted content?

I currently have (not working):
builder.MoveToField(myField, True)
For Each subsection As Aspose.Words.Section In embedBlockDoc.Sections
Dim clone As Aspose.Words.Node = subsection .Clone(True)
clone = e.Document.ImportNode(clone, True)


<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. This article was moved here:


I think it could help you to achieve what you need.

Best regards.

Thank you, that indeed helped me to do exactly what I hoped for.