Insert word template into another word template

We are able to insert a word template document with merge fields into another word document. When the merge operation occurs the whole document is merged.

The limitation is the inserted document is always beginning as a new paragraph.

Is it possible to insert the word document with fields into the master document in-line rather than a new paragraph?



I’m not able to provide sample code, so hopefully I’ve explained myself well enough.



Thanks.

Hi there,

Thanks for your inquiry. I would suggest you please upgrade to the latest version (v15.5.0) from here and use DocumentBuilder.InsertDocument to insert content of the document into the current position of DocumentBuilder’s cursor. Please check following code example for your kind reference.

Document masterDoc = new Document(MyDir + “Master+Document.docx”);

DocumentBuilder builder = new DocumentBuilder(masterDoc);

builder.MoveToDocumentEnd();

Document subDoc = new Document(MyDir + “Sub-document.docx”);

builder.InsertDocument(subDoc, ImportFormatMode.KeepSourceFormatting);

masterDoc.Save(MyDir + “Out.docx”);