Ga naar hoofdinhoud

Hoe een document in meerdere documenten in Word opsplitsen?

Als je een enorm Word-document hebt dat je in meerdere documenten moet splitsen, neem dan een paar minuten om deze tutorial te lezen. Deze tutorial laat je twee methoden zien om een ​​document in meerdere documenten te splitsen.


Splits Word-document op opgegeven scheidingsteken met VBA

In plaats van het document handmatig in meerdere documenten te splitsen, introduceert deze methode een VBA om een ​​Word-document te splitsen door het opgegeven scheidingsteken in Word. Ga als volgt te werk:

1. pers Alt + F11 toetsen samen om het Microsoft Visual Basic for Application-venster te openen;

2. Klikken Invoegen > Moduleen plak vervolgens onder VBA-code in het nieuwe openingsmodule-venster.

VBA: Word-document splitsen in meerdere documenten per scheidingsteken

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. Dan klikken lopen knop of druk op F5 toets om de VBA toe te passen.

4. Klik in het pop-up Microsoft Word-document op de knop Ja om door te gaan.

Opmerking:
(1) Zorg ervoor dat u uw scheidingsteken op dezelfde manier toevoegt als "///" in de subtest van het document tussen elke tekstsectie die u wilt scheiden. U kunt ook wijzigen "///" naar eventuele scheidingstekens om aan uw behoefte te voldoen.
(2) U kunt de documenten wijzigen "Notes" in de subtest om aan uw behoeften te voldoen.
(3) En de gesplitste documenten worden op dezelfde plaats opgeslagen als het originele bestand.
(4) U hoeft geen scheidingsteken toe te voegen aan het einde van het originele bestand, als u dat doet, zal er na het splitsen een blanco document zijn.

Splits Word-document per pagina met VBA

Hier is nog een VBA om u te helpen snel een Word-document op meerdere pagina's in Word te splitsen. Ga als volgt te werk:

1. pers Alt + F11 toetsen samen om het Microsoft Visual Basic for Application-venster te openen;

2. Klikken Invoegen > Moduleen plak vervolgens onder VBA-code in het nieuwe openingsmodule-venster.

VBA: document splitsen in meerdere documenten per pagina 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. Dan klikken lopen knop of druk op F5 sleutel om de VBA toe te passen.

Opmerking: De gesplitste documenten worden op dezelfde plaats opgeslagen als het originele bestand.


Splits Word-document op kop / pagina / sectie-einde / pagina-einde met Kutools voor Word

Als je Kutools for Word hebt geïnstalleerd, kun je het toepassen Split functie om eenvoudig een document op te splitsen in meerdere documenten per pagina, kop, sectie-einde of pagina-einde zoals je nodig hebt in Word.

Kutools for Word is de ultieme Word-invoegtoepassing die uw werk stroomlijnt en uw documentverwerkingsvaardigheden verbetert. Probeer het GRATIS voor 60 dagen! Profiteer nu!

1.Klik Koetools Plus > Split om de Split kenmerk.

2. In het openingsvenster Splitsen op het scherm kunt u het volgende doen:

(1) Kies de splitsingsmanier van de Gesplitst door keuzelijst.
Deze functie ondersteunt 6 splitsingsmanieren: kop 1, pagina-einden, sectie-einden, pagina's, elke n-pagina en aangepaste paginabereiken zoals onderstaand screenshot:

(2) Klik op het Blader  specificeren de doelmap waarin u de gesplitste documenten opslaat;

(3) Typ een trefwoord in als het voorvoegsel van nieuwe documentnamen in het Documentvoorvoegsel doos.

Tips:
(1) Als u specificeert de splitsing van het huidige document door Elke n pagina's, moet u het nummer specificeren in het Elke n pagina's doos;

(2) Als u specificeert om het huidige document te splitsen op basis van aangepaste paginabereiken, moet u deze aangepaste paginabereiken invoeren, gescheiden door komma's in de Pagina Typ bijvoorbeeld 1, 3-5, 12 in het vak.

3. Klik op de Ok knop om te beginnen met splitsen.

Vervolgens wordt het huidige document op de gespecificeerde manier gesplitst en worden nieuwe documenten in bulk in de doelmap opgeslagen.

Bladeren en bewerken met tabbladen in meerdere Word-documenten zoals Firefox, Chrome, Internet Explore 10!

U bent wellicht bekend om meerdere webpagina's in Firefox / Chrome / IE te bekijken en tussen de webpagina's te schakelen door eenvoudig op de overeenkomstige tabbladen te klikken. Hier ondersteunt Office Tab vergelijkbare verwerking, waardoor u door meerdere Word-documenten in één Word-venster kunt bladeren en gemakkelijk tussen de documenten kunt schakelen door op hun tabbladen te klikken. Klik voor gratis proefversie met volledige functies!
Blader door meerdere Word-documenten in één venster als Firefox


Relatieve artikelen:


Beste Office-productiviteitstools

Kutools for Word - Verbeter uw woordervaring met Over 100 Opmerkelijke kenmerken!

🤖 Kutools AI-assistent: Transformeer uw schrijven met AI - Inhoud genereren  /  Herschrijf tekst  /  Documenten samenvatten  /  Informeer voor informatie gebaseerd op document, allemaal binnen Word

📘 Documentbeheersing: Pagina's splitsen  /  Voeg documenten samen  /  Selectie exporteren in verschillende formaten (PDF/TXT/DOC/HTML...)  /  Batchconversie naar PDF  /  Pagina's exporteren als afbeeldingen  /  Meerdere bestanden tegelijk afdrukken...

Inhoud bewerken: Batch zoeken en vervangen over meerdere bestanden  /  Formaat van alle afbeeldingen wijzigen  /  Tabelrijen en -kolommen transponeren  /  Converteer tabel naar tekst...

🧹 Moeiteloos schoon: Veeg weg Extra ruimtes  /  Sectie-onderbrekingen  /  Alle koppen  /  Tekstvakken  /  hyperlinks  / Ga voor meer verwijdergereedschappen naar onze Groep verwijderen...

Creatieve invoegingen: Invoegen Duizend scheidingstekens  /  Vink vakjes aan  /  Radio knoppen  /  QR Code  /  Barcode  /  Diagonale lijntabel  /  Vergelijking bijschrift  /  Bijschrift bij afbeelding  /  Tabel titel  /  Meerdere afbeeldingen  / Ontdek meer in de Groep invoegen...

???? Precisieselecties: Vaststellen specifieke pagina's  /  tafels  /  vormen  /  kop paragrafen  / Verbeter de navigatie met meer Selecteer functies...

Sterverbeteringen: Navigeer snel naar elke locatie  /  automatisch herhaalde tekst invoegen  /  naadloos schakelen tussen documentvensters  /  11 Conversiehulpmiddelen...

👉 Wil je deze functies proberen? Kutools voor Word biedt een Gratis proefperiode van 60-dag, zonder beperkingen! 🚀
 
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