Overview
This article explains how to split a Word (DOCX) document into separate documents using the Split DOCX plugin (SplitDocx) from the GroupDocs.Merger.LowCode package for .NET. GroupDocs Document Merger Plugins are lightweight, single-purpose tools that make merging and splitting documents simple and efficient for .NET developers.
About Document Merger Plugins
GroupDocs Document Merger Plugins are built on our enterprise-grade GroupDocs.Merger SDK. These plugins merge, split, and remove pages in PDF, Word (DOCX), and PowerPoint (PPTX) documents, and are designed for cross-platform use on Windows, macOS, and Linux under .NET 6+. Each plugin offers a lightweight, fixed-price solution for one operation on one format (e.g., Merge PDF), making them ideal for developers who need a simple, focused tool.
Prerequisites
- .NET 6.0 or later
- A license file (
GroupDocs.Merger.LowCode.lic). Without a license, the plugin runs in evaluation mode. - A DOCX file to split
Installation
To install the GroupDocs.Merger.LowCode package, run the following command in your terminal:
dotnet add package GroupDocs.Merger.LowCode
Code Example
The following example puts pages 1, 2, and 3 of source.docx into separate documents:
using GroupDocs.Merger.LowCode;
// Set your license
License.Set("GroupDocs.Merger.LowCode.lic");
// Select pages 1, 2, and 3
var splitter = new SplitDocx("source.docx", new[] { 1, 2, 3 });
// Save each of them as a separate DOCX document
splitter.Save("output/page.docx");
VB.NET Example
Imports GroupDocs.Merger.LowCode
' Set your license
License.Set("GroupDocs.Merger.LowCode.lic")
' Select pages 1, 2, and 3
Dim splitter As New SplitDocx("source.docx", {1, 2, 3})
' Save each of them as a separate DOCX document
splitter.Save("output/page.docx")
F# Example
open GroupDocs.Merger.LowCode
// Set your license
License.Set("GroupDocs.Merger.LowCode.lic")
// Select pages 1, 2, and 3
let splitter = SplitDocx("source.docx", [| 1; 2; 3 |])
// Save each of them as a separate DOCX document
splitter.Save("output/page.docx")
Output
The plugin writes one document per page and adds the page number to the file name: output/page_1.docx, output/page_2.docx, and output/page_3.docx. The output folder is created if it doesn’t exist. To control the names, put {0} in the file name, for example output/page-{0}.docx; the part number replaces it.
Split a Document into Parts
With SplitMode.Interval, the pages you list mark where each new part starts. The following example cuts a document before pages 7 and 13: part_0.docx holds pages 1 to 6, part_1.docx holds pages 7 to 12, and part_2.docx holds pages 13 to the end. Interval parts are numbered from 0.
using GroupDocs.Merger.Domain.Options;
using GroupDocs.Merger.LowCode;
// Start a new part at pages 7 and 13
var splitter = new SplitDocx("source.docx", new[] { 7, 13 }, SplitMode.Interval);
// Save one document per part
splitter.Save("output/part.docx");
Split a Range of Pages
Pass the first and the last page of a range to put every page of the range into a document of its own. Add a RangeMode to keep only the odd or even pages of the range. The following example splits out pages 2, 4, and 6:
using GroupDocs.Merger.Domain.Options;
using GroupDocs.Merger.LowCode;
// Select the even pages from 1 to 6
var splitter = new SplitDocx("source.docx", 1, 6, RangeMode.EvenPages);
// Save one document per page
splitter.Save("output/even.docx");
The source document can also be a Stream. For more examples in C#, VB.NET, and F#, see Using SplitDocx to Split DOCX Documents in the documentation.
Licensing
A license is required to use the plugin without evaluation limitations. In evaluation mode, only the first three pages are processed, and an evaluation message is added to every page of the output. Each plugin is licensed separately. You can obtain a free temporary license for testing: