Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active December 7, 2021 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/0b41e0adc9a80929ced47d11d5aca759 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/0b41e0adc9a80929ced47d11d5aca759 to your computer and use it in GitHub Desktop.
Copy Content from One Word Document to Another in C#
// Load source Word documents
Document doc = new Document("document.docx");
// Clone document
Document newDoc = doc.Clone();
// Save document
newDoc.Save("output.docx");
// Load source and destination Word documents
Document doc = new Document("document.docx");
Document docDest = new Document("document2.docx");
// Copy the content from source document to destination document
docDest.AppendDocument(doc, ImportFormatMode.KeepSourceFormatting);
// Save document
docDest.Save("output.docx");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment