Note: The other languages of the website are Google-translated. Back to English

How to split document into multiple documents in word?

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 a handy add-in to ease your work and enhance your ability of processing word document. Free Trial for 60 days! 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 multiple Word documents as Firefox, Chrome, Internet Explore 10!

You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Word documents in one Word window, and easily switch between them by clicking their tabs. Click for full features free trial!
Browse multiple word documents in one window as Firefox


Relative articles:



Recommended Word Productivity Tools

 

Kutools For Word - More Than 100 Advanced Features For Word, Save Your 50% Time

  • Complicated and repeated operations can be done one-time processing in seconds.
  • Insert multiple images across folders into Word document at once.
  • Merge and combine multiple Word files across folders into one with your desired order.
  • Split the current document into separate documents according to heading, section break or other criteria.
  • Convert files between Doc and Docx, Docx and PDF, collection of tools for common conversions and selection, and so on...
Comments (45)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
When i try to split document the word document by using the above VB code, Its splitting by removing all the images and inseterd objects.
This comment was minimized by the moderator on the site
I'm having a problem similar to Dhamo's. I started with a large file with many embedded content controls. When I split my Word file using the VB code, the content controls were all converted to regular text. Is there any way to split a file without losing the formatting of the original?
This comment was minimized by the moderator on the site
Hello. How I can split .doc not one page per document using these scripts? E.g. 10 or 5 pages per document
This comment was minimized by the moderator on the site
Dear team, VBA for Splitting document into multiple single-paged document is working good, but the problem is split documents are not having the table formats.(table formats in master document are not formatted as table in split documents). Thanks in advance if i can get the macros, so that tabular formats in master document are not disturbed in split documents
This comment was minimized by the moderator on the site
Very helpful thank you! My original document had 'read only' set. This is not transferring into the new documents. Is this possible to add?
This comment was minimized by the moderator on the site
Kutools for Word does not work for read-only documents.
This comment was minimized by the moderator on the site
Unfortunately, I can't split pages with Kutools. What can I do? I get this error message: Informationen über das Aufrufen von JIT-Debuggen anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung. ************** Ausnahmetext ************** System.NotSupportedException: Das angegebene Pfadformat wird nicht unterstützt. bei System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath) bei System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) bei System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) bei System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath) bei System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) bei System.IO.Directory.CreateDirectory(String path) bei Kutools.FormDocumentSplit.€() bei Kutools.FormDocumentSplit.›(Object “, EventArgs ”) bei System.Windows.Forms.Control.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) bei System.Windows.Forms.Control.WndProc(Message& m) bei System.Windows.Forms.ButtonBase.WndProc(Message& m) bei System.Windows.Forms.Button.WndProc(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
This comment was minimized by the moderator on the site
Too hard for a pensioner to comprehend what happened to the old way I windows seven that program was so easy for us older people to follow.
This comment was minimized by the moderator on the site
Your macro works REALLY well, however, I require the split documents to retain their narrow margins and two coluimn layout. More by luck than judgement(!), I managed to achieve this manually and the end result was exactly as I required. I then used the macro recorder but do not have the knowledge of Word VBA to alter the recorded code to achieve this. Can you help? Thanks in advance!
This comment was minimized by the moderator on the site
I tried the first split document code and it did not work. It said it was breaking it into three sections, but it did not.
This comment was minimized by the moderator on the site
The first VBA will split the current document by delimiter "///". Did you add the split delimiter "///" in you document?
This comment was minimized by the moderator on the site
Forget it, I tried several times with the letters numbers, which did not work, then I seen it erased my comments. Just to note the first code did not work for me, it said it was breaking the document into three sections, but did not.
This comment was minimized by the moderator on the site
Does anyone knows how to change the name of the files after splitting the main one I want to change the names according to Header of the file
This comment was minimized by the moderator on the site
I did the VBA Code: split document into multiple documents according to delimiter, it does split the document but unfortunately the graphics are deleted, also formatting. Is there a solution to this?
This comment was minimized by the moderator on the site
Thanks for the macro code
This comment was minimized by the moderator on the site
Thank you, this was very helpful!
This comment was minimized by the moderator on the site
You just saved me a Sh*t load of time, thanks!
This comment was minimized by the moderator on the site
Thanks !

One question do You have any idea to save all the split documents into PDF ?
This comment was minimized by the moderator on the site
I used the code from the "Split Word Document By Page With VBA" section. It worked to split the documents out but messed up the formatting - causing what should have been on 2 pages to be on 5 instead. I played around with the code and ended up finding a solution.


I replaced this line: docSingle.Range.Paste 'paste the clipboard contents to the new document

with this line: docSingle.Range.PasteAndFormat (wdFormatOriginalFormatting)

Hope this helps some of you who've had formatting issues.
This comment was minimized by the moderator on the site
I used the code from the "Split Word Document By Page With VBA" section. How should I amend the code in order to maintain the original header in all of the new files?
This comment was minimized by the moderator on the site
like individual merge add ons
This comment was minimized by the moderator on the site
The Split (Document) feature of Kutools for Word can help users to split a Word document by heading 1, page break, section break, or page.
In addition, Kutools for Word also includes Merge feature to merge multiple Word documents into one.
This comment was minimized by the moderator on the site
i need to split the document using page range. for example i wanted to split 1 to 10 page in another document. how i can do it
This comment was minimized by the moderator on the site
Hi - i have this same question, any way to do this?
This comment was minimized by the moderator on the site
Can you split the document based on Heading 1 styles as your "delimiter".
This comment was minimized by the moderator on the site
Hi Andrew,
The VBA script can split the entire document by page. If you need to split by heading 1, we suggest to try Kutools for Word’s Split (Document) feature.
This comment was minimized by the moderator on the site
Downloaded fodler doesnt open at all. Waiting for a long time.
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations

Follow Us

Copyright © 2009 - www.extendoffice.com. | All rights reserved. Powered by ExtendOffice. | Sitemap
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.
Protected by Sectigo SSL