• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

How to split a Word file into many small files?

AnonyViet by AnonyViet
January 14, 2023
in Office
0

If you have a large word document that needs to be split into several small files, then read this article. The previous article will show you two methods to split a Word file into several small files.

Join the channel Telegram of the AnonyViet 👉 Link 👈

How to split a Word file into many small files?

Split Word file by delimiter with VBA

Instead of manually splitting the file into several smaller ones, this method uses VBA to split the Word document by the delimiter specified in Word.

1. Press the key combination Alt + F11 to open the Microsoft Visual Basic for Applications window;

2. Click Insert > Modulesand then paste the below VBA code into the Module window.

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 the button Run or press F5 key to apply VBA.

4. Click Yes to continue.

How to split a Word file into many small files

Note:

(1) Be sure to add a separator like “///” to the document between each piece of text that you want to split. Alternatively, you can change “///” to any delimiter to meet your needs.

(2) You can change the document”Notes” in the Test sub to suit your needs.

(3) And the split documents will be saved to the same place as the original file.

(4) You don’t need to add a separator at the end of the original file, if you do, it will create an extra blank document after splitting.

Split Word Document by Page with VBA

Here is another VBA code that helps you quickly split a Word document into multiple pages in Word.

1. Press the key combination Alt + F11 to open the Microsoft Visual Basic for Applications window;

2. Click Insert > Modulesand then paste the VBA code below into the Module window.

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 the button Run or press F5 key to apply VBA.

Note: The split documents will be saved to the same place as the original file.

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

Kutools is a handy add-on to make your work easier and improve your ability to handle text documents.

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

How to split a Word file into many small files 10

2. In the dialog box Split is open on the desktop, you can do the following:

How to split a Word file into many small files 11

(1) Choose how to split from the list Split by.

This feature supports 6 splits: header 1, page break, section break, page, every n pages and custom page range as shown below:

How to split a Word file into many small files

(2) Click the button Browse to specify the destination folder in which you will save the split documents.

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

Advice:

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

How to split a Word file into many small files

(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 box Pagefor example, enter 1, 3-5, 12 in the box.

How to split a Word file into many small files

3. Click the Ok button to start splitting.

Then, the current document will be split according to the specified split, and the new documents will be saved in bulk to the destination folder.

How to split a Word file into many small files 15

In addition, you can also automatically save Word files to OneDrive here.

The article achieved: 5/5 – (100 votes)

Tags: filefilessmallsplitword
Previous Post

What is the return leg? The meaning of the first leg in football

Next Post

What is good faith? Meaning of charity?

AnonyViet

AnonyViet

Related Posts

Automatically check and correct spelling errors on Google Docs
Office

Automatically check and correct spelling errors on Google Docs

February 23, 2025
Instructions for downloading Google Docs files easily on any device
Office

Instructions for downloading Google Docs files easily on any device

December 18, 2024
Launching AI image creation feature on Google Docs
Office

Launching AI image creation feature on Google Docs

November 20, 2024
Instructions for using Google Docs without internet
Office

Instructions for using Google Docs without internet

November 2, 2024
Share the link to the sample file to create QR codes in Google Sheets
Office

Share the link to the sample file to create QR codes in Google Sheets

September 30, 2024
Proton Docs: Google Docs Alternative with End-to-End Encryption
Office

Proton Docs: Google Docs Alternative with End-to-End Encryption

September 21, 2024
Next Post
What is good faith?  Meaning of charity?

What is good faith? Meaning of charity?

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

Discover Supermix – Smart playlist on YouTube Music

Discover Supermix – Smart playlist on YouTube Music

May 20, 2025
The 10 best Torrent websites today – 100% still operate

The 10 best Torrent websites today – 100% still operate

May 20, 2025
Share Code Shop Selling Acc game extremely lightweight written in bootstrap

Share Code Shop Selling Acc game extremely lightweight written in bootstrap

May 19, 2025
Instructions for downloading all photos and story from Instagram

Instructions for downloading all photos and story from Instagram

May 19, 2025
Discover Supermix – Smart playlist on YouTube Music

Discover Supermix – Smart playlist on YouTube Music

May 20, 2025
The 10 best Torrent websites today – 100% still operate

The 10 best Torrent websites today – 100% still operate

May 20, 2025
Share Code Shop Selling Acc game extremely lightweight written in bootstrap

Share Code Shop Selling Acc game extremely lightweight written in bootstrap

May 19, 2025
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

Discover Supermix – Smart playlist on YouTube Music

Discover Supermix – Smart playlist on YouTube Music

May 20, 2025
The 10 best Torrent websites today – 100% still operate

The 10 best Torrent websites today – 100% still operate

May 20, 2025
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí SHBET bongdaso

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí SHBET bongdaso