如何將 Word 文件分割成多個獨立文件?
若您有一份大型 Word 文件需要分割成多個較小的文件,本教學將引導您透過三種高效方法輕鬆達成目標。無論您偏好使用 VBA 依特定分隔符號或頁面進行分割,還是選擇 Kutools for Word 提供的簡化功能,都能找到最適合您需求的解決方案。
使用 VBA 依指定分隔符號分割 Word 文件
與手動分割文件相比,您可透過 VBA 依指定分隔符號自動拆分 Word 文件。請依照下列步驟操作:
- 按下 Alt + F11,立即開啟 Microsoft Visual Basic for Applications 視窗!
- 按一下插入> 模組,並將下方的 VBA 程式碼貼到模組視窗中。
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 - 點擊執行按鈕,或按下 F5 鍵即可執行 VBA!
- 在 Microsoft Word 彈出視窗中,點選是以確認。

注意事項:
- 此腳本會在文件中搜尋「///」(位於程式碼第 22 行),以識別文字應分割為獨立檔案的位置。若您的文件使用不同於「///」的分隔符號,請務必更新 VBA 程式碼以對應正確的分隔符號,或直接在文件的所需分割點加入「///」,確保順利執行!
- 您可以將程式碼第 22 行的 「Notes」替換為任何文字,為分割後的文件建立更具意義的檔名前綴,讓檔案管理更清晰有序!
- 分割後的檔案將儲存在與原始檔案相同的位置。
- 文件結尾處無需加入分隔符號,否則將產生空白檔案。
使用 Kutools for Word 依標題/頁面/分節符/分頁符分割 Word 文件
Kutools for Word 相較於手動操作或 VBA,提供更便捷且彈性的文件分割方式,支援多種分割選項,包括依標題、頁面、分節符、分頁符、文件頁碼倍數或自訂頁面範圍進行分割,讓您能根據實際需求靈活調整分割流程。
- 點擊 KUTOOLS PLUS > 分割,立即啟用分割功能!

- 在文件拆分對話方塊中,設定下列選項:

- 從分割依據下拉選單中選擇一種分割方式,包括標題 1、分頁符、分節符、頁面、文件頁碼倍數或自訂頁面範圍。

- 點擊瀏覽按鈕
,即可選取分割檔案的目標資料夾。 - 在文件前綴欄位中輸入關鍵字,作為新文件名稱的前置詞。提示:點擊重新整理按鈕
,即可在預覽框中立即預覽拆分後的文件名! - 點擊確定。
- 從分割依據下拉選單中選擇一種分割方式,包括標題 1、分頁符、分節符、頁面、文件頁碼倍數或自訂頁面範圍。
文件將依指定方式分割,並儲存至您指定的資料夾。
注意事項:
- 若依文件頁碼倍數分割,請於對應方框中指定數量。

- 針對自訂頁面範圍,請以逗號分隔輸入(例如:1,3-5,12)。

為多份 Word 文件提供分頁瀏覽與編輯功能,就像 Chrome 和 Edge 一樣!
就像在 Chrome、Safari 和 Edge 中瀏覽多個網頁一樣,Office Tab 讓您能在單一視窗中開啟並管理多份 Word 文件——現在只需點擊對應分頁,即可輕鬆切換!
立即免費試用 Office Tab!

使用 VBA 依頁面分割 Word 文件
若您需要快速將 Word 文件分割為多個文件,且每個文件僅包含一頁,可透過 VBA 巨集自動完成這項任務。請依照下列步驟操作:
- 按下 Alt + F11,立即開啟 Microsoft Visual Basic for Applications 視窗!
- 按一下插入> 模組,然後將下列 VBA 程式碼貼到新的模組視窗中:
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 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 (no 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 - 點擊執行按鈕,或按下 F5 鍵,立即執行 VBA!
注意:分割後的檔案將儲存於與原始檔案相同的位置。
相關文章:
最佳 Office 生產力工具
Kutools for Word——透過超過 100 項卓越功能,全面提升您的 Word 體驗!
🤖KUTOOLS AI 功能:AI 助手/即時助手/超級潤色(保留格式)/超級翻譯(保留格式)/AI 遮擋/AI 校正……
📘 文件掌控力:分割頁面/文檔合併/以多種格式匯出選取內容(PDF/TXT/DOC/HTML……)/批次轉換為 PDF……
✏ 內容編輯:批量查找與替換多個檔案/調整所有圖片大小/翻轉表格列與欄/表格轉文本……
🧹 輕鬆清理:一鍵清除多餘空格、分節符、文字框與超連結!想要更多清除工具?立即前往移除群組……
➕ 創意插入:插入千位分隔符/複選框/選項按鈕/二維碼/條碼/多張圖片/ 更多功能請至插入群組……
🔍 精準選取:精確定位特定頁面/表格/圖形/標題段落/ 透過更多選取功能提升導覽效率……
⭐ 星級增強功能:快速跳轉至任意位置/自動插入重複文字/在文件 Windows 之間切換/11 轉換工具……
🌍 支援 40+ 種語言:使用您熟悉的慣用語言暢享 Kutools!支援英文、西班牙文、德文、法文、中文等 40 多種語言,操作更順手、體驗更流暢!

Office Tab- 為 Office 帶來分頁式介面,讓您的工作更輕鬆
- 在 Word、Excel、PowerPoint、Publisher、Access、Visio 與 Project 中啟用分頁式編輯與閱讀體驗。
- 在同視窗的新分頁中開啟並建立多份文件,而非另開新視窗。
- 每天為您減少數百次滑鼠點擊,生產力提升 50%!
✨ Kutools for Office – 一次安裝,五大強大工具!
包含 Office Tab Pro·Kutools for Excel·Kutools for Outlook·Kutools for Word·Kutools for PowerPoint
📦 一套整合 5 項工具 | 🔗 與 Microsoft Office 無縫整合 | ⚡ 保存時間,立即提升生產力




,即可在預覽框中立即預覽拆分後的文件名!
