Related blog post:
Last active
June 8, 2023 08:21
-
-
Save GroupDocsGists/176f95f46fef1fa8c7c444d665d859b8 to your computer and use it in GitHub Desktop.
Merge Word Documents using C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Merge Selective Pages of Word Documents using C# | |
using (Merger merger = new Merger("source_document.docx")) | |
{ | |
// Set the merging options | |
JoinOptions joinOptions = new JoinOptions(2,3); // Specify the starting and ending page number | |
// Merge the documents | |
merger.Join("document_to_merge.docx", joinOptions); // using joining settings | |
merger.Join("another_document_to_merge.docx", new JoinOptions(new[] { 2, 4, 6 })); // Specifying page number(s) | |
merger.Save("output_document.docx"); // Saving merged document | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Merge Two Word Documents using C# | |
Merger merger = new Merger("source_document.docx"); // Load the source document | |
merger.Join("document_to_merge.docx"); // Merge the document | |
merger.Join("another_document_to_merge.docx"); // Merge additional documents | |
merger.Save("output_document.docx"); // Save the merged document as output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment