Is it possible to copy a word file and append it to the end of another?


If I have a word template file that I am using for mail merge, is it possible for me to perform the mail merge for one set of data, and then perform it again for a second set of data,
and then finally append the 2 together to create a single document?

I am trying this at the moment by Creating 2 Document objects and calling .AppendDocument on the first one to add the second, but it isn’t working - I just have a document with the results of the first merge.

Code sample looks like this:

var page1 = new Document(_pathName);

// now add page 2:
var page2 = new Document(_pathName); // Same source file as the origninal.

// The following line makes no difference
page1.AppendDocument(page2, ImportFormatMode.UseDestinationStyles);


Thanks for your request. AppendDocument should work for you. Do you save the output as PDF? If so, please try calling UpdatePageLayout before saving the document:


Hope this helps.
Best regards,

Thanks, that seems to work, along with using the .clone method to copy the document in the first instance.