...
Code Block |
---|
public void GenerateDocument() { // Initialize the WordApplication and create a blank document. WordApplication app = new WordApplication(); Document doc = app.Create(); // Open first document to merge Document doc1 = app.Open(@"..\..\Templates\MergeDocuments1.doc"); // Append first document doc.Append(doc1); // Open second document to merge Document doc2 = app.Open(@"..\..\Templates\MergeDocuments2.doc"); // Append second document doc.Append(doc2); // Open third document to merge Document doc3 = app.Open(@"..\..\Templates\MergeDocuments3.doc"); // Append third document doc.Append(doc3); // Save the merged document app.Save(doc, @"..\..\Output\MergedDocument_out.doc"); } |
Download
Template filesFiles to be Merged:
Output File: MergedDocument_out.doc