Free Support Forum -

How to insert other documents- images and text to the document


Is the feature of inserting images and inserting text [i.e. documents or text files] to the document using Aspose?

To insert images use DocumentBuilder.InsertImage method.

To insert text use DocumentBuilder.Write and DocumentBuilder.Writeln methods.

To insert sections from one document to another use Document.ImportNode method:

Document srcDoc;

Document destDoc = new Document(destFilename);

srcDoc = new Document(srcFilename);

foreach(Section section in srcDoc.Sections)


Section sec = (Section)destDoc.ImportNode(section, true, ImportFormatMode.KeepSourceFormatting);



Thanks for the reply.

From MS word have a feature of including an image by insert image merge field and inserting documents or txt files by insert text merge fiels. I want to whether this feature is supported by Aspose.word?


Yes, these features are supported by ASpose.Words.

Read MailMerge section of our documentation to find out how to use these features.