Merge DOCM

How to merge DOCM files in C#

GroupDocs.Merger allows developers to merge DOCM files when it’s needed to organize multiple DOCM files into single document or send fewer attachments etc. And you can do this without¬†any third-party software or manual work involved. With GroupDocs.Merger it is possible to combine DOCM documents of any size and structure - all text, images, tables, graphs, forms and other content will be preserved.

The following example demonstrates how to merge DOCM files with several lines of C# code:

  • Create an instance of Merger class and pass source DOCM file path as a constructor parameter. You may specify absolute or relative file path as per your requirements.
  • Add another DOCM file to merge with Join method. Repeat this step for other DOCM documents you want to merge.
  • Call Merger class Save method and specify the filename for the merged DOCM file as parameter.
// Load the source DOCM file
using (Merger merger = new Merger(@"c:\sample1.docm"))
{
    // Add another DOCM file to merge
    merger.Join(@"c:\sample2.docm");
    // Merge DOCM files ans save result
    merger.Save(@"c:\merged.docm");
}

About DOCM File Format

DOCM files are Microsoft Word 2007 or higher generated documents with the ability to run macros. It is similar to DOCX file format but the ability to run macros makes it different from DOCX. Like DOCX, DOCM files can be store text, images, tables, shapes, charts and other contents. The capability to run macros make it easy to save time by executing the series of commands in the form of recorded actions for automatic completion of a task. DOCM files can be opened and edited in Microsoft Word 2007 and above.

Code Examples

Please find more use-cases and complete C# sources of our backend and frontend examples and try them for free!

Merge DOCM Live Demo

GroupDocs.Merger for .NET provides an online DOCM Merger App, which allows you to try it for free and check its quality and accuracy.

“Merge DOCM”