//Open the source document
WordDocument sourceDocument = new WordDocument(sourceFileName);
//Open the destination document
WordDocument destinationDocument = new WordDocument(targetFileName);
//Import the contents of source document at the end of destination document
destinationDocument.ImportContent(sourceDocument, ImportOptions. KeepSourceFormatting);
//Close the document instance
sourceDocument.Close();
//Save the destination document
destinationDocument.Save(outputFileName, FormatType.Docx);
//Close the document instance
destinationDocument.Close(); |
|