メインコンテンツへスキップ

ドキュメントをWordで複数のドキュメントに分割するにはどうすればよいですか?

複数のドキュメントに分割する必要がある大量のWordドキュメントがある場合は、このチュートリアルを読むのに数分かかります。 このチュートリアルでは、ドキュメントを複数のドキュメントに分割するXNUMXつの方法を示します。


VBAを使用して指定された区切り文字でWord文書を分割する

この方法では、ドキュメントを手動で複数のドキュメントに分割する代わりに、VBAを導入して、Wordで指定された区切り文字でWordドキュメントを分割します。 次のようにしてください。

1。 押す Altキー+ F11 キーを一緒に押して、Microsoft Visual Basic forApplicationウィンドウを開きます。

2に設定します。 OK をクリックします。 インセット > モジュール、次に、VBAコードの下を新しい開いているモジュールウィンドウに貼り付けます。

VBA:区切り文字でWord文書を複数の文書に分割

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。 次に、をクリックします ラン ボタンを押すか、F5キーを押してVBAを適用します。

4。 ポップアウトするMicrosoftWord文書で、[はい]ボタンをクリックして先に進んでください。

注:
(1)必ずと同じように区切り文字を追加してください 「///」 分離したいテキストの各セクション間のドキュメントへのサブテストで。 また、変更することができます 「///」 あなたのニーズを満たすために任意の区切り文字に。
(2)書類を変更することができます "ノート" あなたのニーズに合うようにサブテストで。
(3)分割文書は、元のファイルと同じ場所に保存されます。
(4)元のファイルの末尾に区切り文字を追加する必要はありません。追加すると、分割後に空白のドキュメントが作成されます。

VBAを使用してWord文書をページごとに分割

これは、XNUMXつのWord文書をWordのページごとに複数にすばやく分割するのに役立つ別のVBAです。 次のようにしてください。

1。 押す Altキー+ F11 キーを一緒に押して、Microsoft Visual Basic forApplicationウィンドウを開きます。

2に設定します。 OK をクリックします。 インセット > モジュール、次に、VBAコードの下を新しい開いているモジュールウィンドウに貼り付けます。

VBA: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。 次に、をクリックします ラン ボタンまたはプレス F5 VBAを適用するためのキー。

注: 分割されたドキュメントは、元のファイルと同じ場所に保存されます。


Kutools for Wordを使用して、見出し/ページ/セクション区切り/改ページでWord文書を分割する

Kutools for Wordがインストールされている場合は、それを適用できます スプリット Wordで必要に応じて、XNUMXつのドキュメントをページ、見出し、セクション区切り、または改ページごとに簡単に複数のドキュメントに分割する機能。

Kutools for Word は、作業を効率化し、文書処理スキルを高める究極の Word アドインです。 無料でお試しください 60 日々! それを今すぐ入手!

1。クリック クツールズプラス > スプリット を有効にする スプリット 特徴。

2。 画面の[分割]ダイアログを開くと、次のように実行できます。

(1)から分割方法を選択します 分割 ドロップダウンリスト。
この機能は、以下のスクリーンショットに示すように、見出し6、改ページ、セクション区切り、ページ、nページごと、およびカスタムページ範囲の1つの分割方法をサポートします。

(2)をクリックします ブラウズ (Comma Separated Values) ボタンをクリックして、各々のジョブ実行の詳細(開始/停止時間、変数値など)のCSVファイルをダウンロードします。  指定します 分割されたドキュメントを保存する宛先フォルダ。

(3)新しいドキュメント名のプレフィックスとしてキーワードを入力します ドキュメントプレフィックス ボックス。

ヒント:
(1)現在のドキュメントを次のように分割するように指定した場合 nページごと、で番号を指定する必要があります nページごと ボックス;

(2)現在のドキュメントをカスタムページ範囲で分割するように指定する場合は、これらのカスタムページ範囲をカンマで区切って入力する必要があります。 ページへ移動します。 たとえば、ボックスに1、3-5、12と入力します。

3。 クリック Ok 分割を開始するボタン。

次に、現在のドキュメントが指定された分割方法で分割され、新しいドキュメントが宛先フォルダーにまとめて保存されます。

Firefox、Chrome、Internet Explore 10などの複数のWord文書のタブブラウジングと編集!

Firefox / Chrome / IEで複数のウェブページを表示し、対応するタブをクリックしてそれらを簡単に切り替えることはおなじみかもしれません。 ここで、Officeタブは同様の処理をサポートしており、XNUMXつのWordウィンドウで複数のWord文書を参照し、タブをクリックすることで簡単に切り替えることができます。 全機能の無料トライアルをクリックしてください!
FirefoxとしてXNUMXつのウィンドウで複数のWord文書を閲覧する


関連記事:


最高のオフィス生産性向上ツール

Kutools for Word - Over で単語体験を向上させましょう 100 注目すべき機能!

🤖 Kutools AI アシスタント: AI であなたの文章を変革します - コンテンツを生成する  /  テキストを書き換える  /  文書を要約する  /  情報のお問い合わせ 文書に基づいて、すべて Word 内で

📘 ドキュメントマスタリー: 分割ページ  /  ドキュメントをマージする  /  選択内容をさまざまな形式でエクスポート (PDF/TXT/DOC/HTML...)  /  PDFへの一括変換  /  ページを画像としてエクスポート  /  複数のファイルを一度に印刷する...

コンテンツ編集: バッチ検索と置換 複数のファイルにわたる  /  すべての画像のサイズを変更する  /  テーブルの行と列を転置する  /  表をテキストに変換...

🧹 楽にお掃除:振り払って 余分なスペース  /  セクションブレーク  /  すべてのヘッダー  /  テキストボックス  /  ハイパーリンク  / その​​他の取り外しツールについては、当社の Web サイトをご覧ください。 グループを削除...

クリエイティブインサート:挿入 千の区切り文字  /  チェックボックス  /  ラジオボタン  /  QRコード  /  バーコード  /  斜線テーブル  /  方程式のキャプション  /  画像キャプション  /  テーブルキャプション  /  複数の写真  / 詳細については、 グループを挿入...

🔍 正確な選択: ピンポイント 特定のページ  /  テーブル  /  シェイプ  /  見出し段落  / ナビゲーションを強化する 他には? 機能の選択...

スターの強化: あらゆる場所に素早く移動  /  繰り返しのテキストを自動挿入  /  ドキュメントウィンドウをシームレスに切り替える  /  11 変換ツール...

👉 これらの機能を試してみませんか? Kutools for Wordは、 60日無料トライアル、制限なし! 🚀
 
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.
This comment was minimized by the moderator on the site
The script saves a two pages document, the second is total blank.

How to solve this?
This comment was minimized by the moderator on the site
Hi Jorge,
The VBA script introduced splits document by the separator “///”, and 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.
This comment was minimized by the moderator on the site
Hi kellytte, Could you please explain a little further? I copy and paste the VBA script under the "Split Word by Document with VBA" from above and after I run the process following the instructions above, I always have to manually delete a 2nd blank page on each of the new documents that were created. Are you saying there is something that needs to be removed from the VBA script that will cause this to stop?
This comment was minimized by the moderator on the site
The split works great for me but on page in the merge file turns into 1.5 pages - something with the page layout (+ additional empty page at the end). any ideas how to go around that?
This comment was minimized by the moderator on the site
The Split Word By Document with VBA worked for me, but it is adding a blank page at the end of each document. Is there a way around this?
This comment was minimized by the moderator on the site
I am working on this as well but have not found a way to do it besides manually.
This comment was minimized by the moderator on the site
Does not work at all for me. Goes through the motions but no documents are saved. Maybe because I am using .DOCX files?
This comment was minimized by the moderator on the site
After playing with this code for over an hour I discovered you have to save the document you mail merged then you can run the code on the saved document that has all the pages you need to split up. Hope this helps.
This comment was minimized by the moderator on the site
I always start with a newly-saved document. I found the split documents were actually saved somewhere (I forget; doesn't matter) they were text only - all the formatting had been dropped.
This comment was minimized by the moderator on the site
Maybe something to do with Windows 7 settings? Thoughts from anyone?
This comment was minimized by the moderator on the site
Mais comment garder une mise en page complexe (image de fond, marges, etc) ?
Great but how to keep the lay-out (background image, margins ?)
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
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations