Skip to main content

How to split document into multiple documents in word?

Author: Amanda Li Last Modified: 2020-12-23

If you have a massive word document which you need to split into multiple documents, take a few minutes to read this tutorial. This tutorial will show you two methods for splitting a document into multiple documents.


Split Word document by specified delimiter with VBA

Instead of splitting document into multiple documents manually, this method will introduce a VBA to split a Word document by the specified delimiter in Word. Please do as follows:

1. Press Alt + F11 keys together to open the Microsoft Visual Basic for Application window;

2. Click Insert > Module, and then paste below VBA code into the new opening Module window.

VBA: Split Word Document into Multiple Documents by Delimiter

Sub SplitNotes(delim As String, strFilename As String)
Dim doc As Document
Dim arrNotes
Dim I As Long
Dim X As Long
Dim Response As Integer
arrNotes = Split(ActiveDocument.Range, delim)
Response = MsgBox("This will split the document into " & UBound(arrNotes) + 1 & " sections.Do you wish to proceed?", 4)
If Response = 7 Then Exit Sub
For I = LBound(arrNotes) To UBound(arrNotes)
If Trim(arrNotes(I)) <> "" Then
X = X + 1
Set doc = Documents.Add
doc.Range = arrNotes(I)
doc.SaveAs ThisDocument.Path & "\" & strFilename & Format(X, "000")
doc.Close True
End If
Next I
End Sub
Sub test()
'delimiter & filename
SplitNotes "///", "Notes "
End Sub

3. Then click Run button or press F5 key to apply the VBA.

4. In the popping out Microsoft Word document, please click the Yes button to go ahead.

Note:
(1) Be sure to add your delimiter as the same as "///" in the sub test to the document between each section of text you wish to separate. Also, you can change "///" to any delimiters to meet your need.
(2) You can change the documents "Notes" in the sub Test to suit your needs.
(3) And the splitting documents will be saved to the same place with the original file.
(4) You do not need to add delimiter to the end of the original file, if you do, there will be a blank document after splitting.

Split Word document by page with VBA

Here is another VBA to help you quickly split one Word document to multiple by page in Word. Please do as follows:

1. Press Alt + F11 keys together to open the Microsoft Visual Basic for Application window;

2. Click Insert > Module, and then paste below VBA code into the new opening Module window.

VBA: Split Document into Multiple Documents by Page in Word

Sub SplitIntoPages()
Dim docMultiple As Document
Dim docSingle As Document
Dim rngPage As Range
Dim iCurrentPage As Integer
Dim iPageCount As Integer
Dim strNewFileName As String
Application.ScreenUpdating = False 'Makes the code run faster and reduces screen _
flicker a bit.
Set docMultiple = ActiveDocument 'Work on the active document _
(the one currently containing the Selection)
Set rngPage = docMultiple.Range 'instantiate the range object
iCurrentPage = 1
'get the document's page count
iPageCount = docMultiple.Content.ComputeStatistics(wdStatisticPages)
Do Until iCurrentPage > iPageCount
If iCurrentPage = iPageCount Then
rngPage.End = ActiveDocument.Range.End 'last page (there won't be a next page)
Else
'Find the beginning of the next page
'Must use the Selection object. The Range.Goto method will not work on a page
Selection.GoTo wdGoToPage, wdGoToAbsolute, iCurrentPage + 1
'Set the end of the range to the point between the pages
rngPage.End = Selection.Start
End If
rngPage.Copy 'copy the page into the Windows clipboard
Set docSingle = Documents.Add 'create a new document
docSingle.Range.Paste 'paste the clipboard contents to the new document
'remove any manual page break to prevent a second blank
docSingle.Range.Find.Execute Findtext:="^m", ReplaceWith:=""
'build a new sequentially-numbered file name based on the original multi-paged file name and path
strNewFileName = Replace(docMultiple.FullName, ".doc", "_" & Right$("000" & iCurrentPage, 4) & ".doc")
docSingle.SaveAs strNewFileName 'save the new single-paged document
iCurrentPage = iCurrentPage + 1 'move to the next page
docSingle.Close 'close the new document
rngPage.Collapse wdCollapseEnd 'go to the next page
Loop 'go to the top of the do loop
Application.ScreenUpdating = True 'restore the screen updating
'Destroy the objects.
Set docMultiple = Nothing
Set docSingle = Nothing
Set rngPage = Nothing
End Sub 

3. Then click Run button or press F5 key to apply the VBA.

Note: The splitting documents will be saved to the same place with the original file.


Split Word document by heading/page/section break/page break with using Kutools for Word

If you have Kutools for Word installed, you can apply its Split function to easily split one document into multiple ones by page, heading, section break, or page break as you need in Word..

Kutools for Word is the ultimate Word add-in that streamlines your work and boosts your document processing skills. Get It Now!

1.Click Kutools Plus > Split to enable the Split feature.

2. In the opening Split dialog in the screen, you can do as follows:

(1) Choose the splitting way from the Split by drop-down list.
This feature supports 6 splitting ways: heading 1, page breaks, section breaks, pages, every n pages, and custom page ranges as below screenshot shown:

(2) Click the Browse button  to specify the destination folder you will save the split documents into;

(3) Type in a keyword as the prefix of new document names in the Document Prefix box.

Tips:
(1) If you specify the split the current document by Every n pages, you need to specify the number in the Every n pages box;

(2) If you specify to split the current document by custom page ranges, you need to enter these custom page ranges separated by commas in the Page box, for example, type 1, 3-5, 12 in the box.

3. Click the Ok button to start splitting.

Then the current document is split by the specified splitting way, and new documents will be saved into the destination folder in bulk.

Tabbed Browsing & Editing for Multiple Word Documents, Just Like in Chrome and Edge!

Just like browsing multiple webpages in Chrome, Safari and Edge, Office Tab lets you open and manage multiple Word documents in a single window. Switching between documents is now simple with a click on their tabs!
Try all features for free now!

Browse multiple word documents in one window as Firefox


Relative articles:


Best Office Productivity Tools

Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!

🤖 Kutools AI Assistant: Transform your writing with AI - Generate Content  /  Rewrite Text  /  Summarize Documents  /  Get Quick Answers, all within Word

📘 Document Mastery: Split Pages  /  Merge Documents  /  Export Selection in Various Formats (PDF/TXT/DOC/HTML...)  /  Batch Convert to PDF  /  Export Pages as Images  /  Print Multiple Files at once...

Contents Editing: Batch Find and Replace across Multiple Files  /  Resize All Pictures  /  Transpose Table Rows and Columns  /  Convert Table to Text...

🧹 Effortless Clean: Sweap away Extra Spaces  /  Section Breaks  /  All Headers  /  Text Boxes  /  Hyperlinks  /  For more removing tools, head to the Remove group...

Creative Inserts: Insert Thousand Separators  /  Check Boxes  /  Radio Buttons  /  QR Code  /  Barcode  /  Diagonal Line Table  /  Equation Caption  /  Image Caption  /  Table Caption  /  Multiple Pictures  /  Discover more in the Insert group...

🔍 Precision Selections: Pinpoint Specific Pages  /  Tables  /  Shapes  /  Heading Paragraphs  /  Enhance navigation with more Select features...

Star Enhancements: Navigate to Any Location  /  Auto-Insert Repetitive Text  /  Toggle Between Document Windows  /  11 Conversion Tools...

Kutools and Kutools Plus tabs on the Word Ribbon
👉 Want to try these features? Download Kutools for Word now! 🚀
 
Comments (45)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
VBA: Split Document into Multiple Documents by Page in Word - in this when we run it, outcome comes in portrait layout only. If original doc is in landscape then full data of the original doc does not come in the pages breaked by this vba.. There must be seperate vba for portrait and landscape docs.
This comment was minimized by the moderator on the site
I use the "split"-function of "Kutools For Word 9.00" with "header 1" and it works for 48 documents and then it simply stops without any message, as if it wohl have been finished. But I have 700 "header 1" in a 2000 pages document!
Is it simply too much for the tool or is there any other reason?
This comment was minimized by the moderator on the site
your code add new blank page in every page
This comment was minimized by the moderator on the site
This worked fine up until yesterday with Office365, but now I constantly get a runtime error '4605' stating this command is not available. Sometimes at the first page, sometimes at the 3rd page...I can't make it past 3 pages anymore. It happens with line 28 above...

docSingle.Range.Paste 'paste the clipboard contents to the new document
This comment was minimized by the moderator on the site
I've got this error too - Did you get anywhere with it?


Thanks
This comment was minimized by the moderator on the site
yes...i have to run it on the local hard drive. if i run it on a network file or with RemotePC it. has something to do with the script having to wait too long in between commands and it errors out copy and pasting to the clipboard. hope that helps!!
This comment was minimized by the moderator on the site
I copied the document distribution macro 'Split Word Document By Specified Delimiter With VBA', but in the line of 'sub test', the software reads it as a new macro and there are two macros here.
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations