How to use template within template using mail merge

Hi Team,

I have a query on mail merge.

  1. How do you to create the template within template(recursively) using mail merge concept?.
  2. How to attach the pdf/docx content in template of mail merge?.

Regards,
Suresh Shanmugam.

Hi Suresh,

Thanks for your inquiry. Please refer to the following section of documentation:
How to Execute Mail Merge

Secondly, you can implement IFieldMergingCallback interface and in the IFieldMergingCallback.FieldMerging method insert embedded OLE objects (PDF/Excel etc) in Microsoft Word document. Please see the following examples:

Insert embedded Excel 97-2003 document as iconic OLE object from stream using predefined image:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Stream memoryStream = File.OpenRead(MyDir + "Book1.xls");
Shape oleObject = builder.InsertOleObject(memoryStream, "Excel.Sheet.8", true, null);
doc.Save(MyDir + @"out.docx");

Insert linked Word document from file as normal OLE object using custom presentation image

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Image image = Image.FromFile(MyDir + "Aspose.Words.png");
Shape oleObject = builder.InsertOleObject(MyDir + "Doc1.docx", true, false, image);
doc.Save(MyDir + @"out.docx");

Hope, this helps.

Best regards,

Hi hafeez,

Thanks for your info.
Actually we need to render document inside the another document. Ex:- I have two document doc1 & doc2. I need to render the doc2 into doc1. The doc2 should be render last page of the doc1.

We need to render the format of file (docx,pdf, image). Please help me on the same.

Thanks,
Suresh.

Hi Suresh,

Thanks for your inquiry. Please refer to the following article:

Joining and Appending Documents

Hope, this helps.

Best regards,