Merge Word documents

GroupDocs.Merger provides an easy way to merge Microsoft Word documents of DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF formats and Open Document formats like ODT, OTT etc. It takes just single line of code to append one document to another preserving all content - page setup, headers and footers, formatting, styles and other content. There is no third-party applications required (like Microsoft Word and Open Office). 

GroupDocs.Merger API provides different overloads of join method to combine additional files with the source document loaded into Merger object. 

  • join(String) - allows to merge document provided via file path on a local disk; 
  • join(InputStream) - provides an ability to combine documents loaded from any source - memory stream, remote URL etc.;
  • join(StringIJoinOptions) - is used for merging specific pages for document stored at local disk; 
  • join(InputStreamIJoinOptions) - used for merging specific pages from document provided as a stream.

This code sample shows how to merge Microsoft Word documents:

Merger merger = new Merger(@"c:\document1.docx"); 

More resources

Advanced Usage Topics 

To learn more about document merging features, please refer the advanced usage section.

GitHub Examples 

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App 

Along with full featured Java library we provide simple, but powerful free Apps. You are welcome to merge your documents with our free online GroupDocs Merger App.