Ugrás a tartalomra

Hogyan lehet dokumentumot több dokumentumra felosztani szóban?

Ha masszív Word dokumentummal rendelkezik, amelyet több dokumentumra kell bontania, szánjon néhány percet az oktatóanyag elolvasására. Ez az oktatóanyag két módszert mutat be a dokumentum több dokumentumra történő felosztására.


Felosztja a Word dokumentumot egy meghatározott elválasztóval a VBA segítségével

Ahelyett, hogy a dokumentumot több dokumentumra bontaná manuálisan, ez a módszer egy VBA-t vezet be, amely egy Word-dokumentumot feloszt a Word meghatározott elválasztójával. Kérjük, tegye a következőket:

1. nyomja meg Alt + F11 billentyűk együttesen a Microsoft Visual Basic for Application ablak megnyitásához;

2. Kattints betétlap > Modulok, majd illessze be a VBA kód alá az új nyitó Modul ablakba.

VBA: A Word dokumentum felosztása több dokumentumra elválasztóval

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. Ezután kattintson futás gombot vagy nyomja meg az F5 gombot a VBA alkalmazásához.

4. Az előugró Microsoft Word dokumentumban kattintson az Igen gombra a folytatáshoz.

Jegyzet:
(1) Ne felejtse el megadni az elválasztóját ugyanúgy, mint a "///" az al tesztben a különálló szövegrészek között lévő dokumentumhoz. Ezenkívül megváltoztathatja "///" bármely elválasztóhoz, hogy megfeleljen az Ön igényeinek.
(2) Megváltoztathatja a dokumentumokat "Jegyzetek" az al Teszt az Ön igényeinek megfelelően.
(3) A felosztó dokumentumokat ugyanarra a helyre menti az eredeti fájl.
(4) Nem szükséges elválasztót hozzáadni az eredeti fájl végéhez, ha mégis, akkor a felosztás után üres dokumentum lesz.

A Word dokumentumot oldalanként ossza fel a VBA segítségével

Itt van egy másik VBA, amely segít gyorsan felosztani egy Word-dokumentumot oldalanként többször a Word-ben. Kérjük, tegye a következőket:

1. nyomja meg Alt + F11 billentyűk együttesen a Microsoft Visual Basic for Application ablak megnyitásához;

2. Kattints betétlap > Modulok, majd illessze be a VBA kód alá az új nyitó Modul ablakba.

VBA: A dokumentum felosztása több dokumentumra oldalanként a Wordben

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. Ezután kattintson futás vagy nyomja meg a gombot F5 kulcs a VBA alkalmazásához.

Jegyzet: A felosztó dokumentumokat ugyanarra a helyre menti az eredeti fájl.


A Word dokumentum felosztása címsor/oldal/szakasz/oldaltörés szerint a Kutools for Word használatával

Ha telepítette a Kutools for Word programot, alkalmazhatja Hasított funkcióval könnyen feloszthatja az egyik dokumentumot oldalakra, fejlécekre, szakaszokra vagy oldalakra, amire a Word-ben szüksége van.

Kutools for Word a Word végső bővítménye, amely leegyszerűsíti a munkáját és javítja dokumentumfeldolgozási készségeit. Próbáld ki INGYENESEN 60 napok! Szerezd meg most!

1.Kattints Kutools Plus > Hasított hogy engedélyezze a Hasított funkciót.

2. A képernyőn a Megnyitás párbeszédpanelen a következőket teheti:

(1) Válassza ki a hasítási módot a Felosztva legördülő listából.
Ez a szolgáltatás 6 felosztási módot támogat: 1. címsor, oldaltörések, szakaszszakaszok, oldalak, n oldalanként és egyéni oldaltartományok az alábbi képernyőkép szerint:

(2) Kattintson a gombra Tallózás gomb  pontosítani a célmappát, ahová a felosztott dokumentumokat menteni fogja;

(3) Írjon be egy kulcsszót az új dokumentumnevek előtagjaként a Dokumentum előtag doboz.

Tipp:
(1) Ha megadja az aktuális dokumentum felosztását N oldalanként, meg kell adnia a számot a N oldalanként doboz;

(2) Ha megadja az aktuális dokumentum egyéni oldaltartományok szerinti felosztását, ezeket az egyéni oldaltartományokat vesszővel elválasztva kell megadnia a oldal mezőbe írja be például az 1, a 3-5, a 12 mezőt.

3. Kattintson az Ok gombot a hasítás megkezdéséhez.

Ezután az aktuális dokumentumot a megadott felosztási módszerrel osztja fel, és az új dokumentumokat tömegesen menti a célmappába.

Füles böngészés és több Word-dokumentum szerkesztése, például Firefox, Chrome, Internet Explore 10!

Előfordulhat, hogy ismerős lehet több weboldal megtekintése Firefox/Chrome/IE böngészőben, és a megfelelő lapokra kattintva válthat közöttük. Itt az Office Tab támogatja a hasonló feldolgozást, amely lehetővé teszi több Word-dokumentum böngészését egy Word-ablakban, és a fülükre kattintva könnyedén válthat közöttük. Kattintson a teljes funkciós ingyenes próbaverzióhoz!
Böngésszen több szavas dokumentumot egy ablakban Firefox néven


Relatív cikkek:


A legjobb irodai hatékonyságnövelő eszközök

Kutools for Word - Növelje Word-élményét az Over segítségével 100 Figyelemre méltó tulajdonságok!

🤖 Kutools AI asszisztens: Alakítsa át írását mesterséges intelligencia segítségével - Tartalom létrehozása  /  Szöveg átírása  /  Összefoglalja a dokumentumokat  /  Információért érdeklődjön dokumentum alapján, mindezt a Word-en belül

📘 Dokumentummesterség: Felosztott oldalak  /  Dokumentumok egyesítése  /  Kijelölés exportálása különböző formátumokban (PDF/TXT/DOC/HTML...)  /  Kötegelt konvertálás PDF-be  /  Oldalak exportálása képként  /  Nyomtasson több fájlt egyszerre...

Tartalom Szerkesztés: Kötegelt keresés és csere Több fájl között  /  Minden kép átméretezése  /  Transzponálja a táblázat sorait és oszlopait  /  Táblázat konvertálása szöveggé...

🧹 Könnyed tisztítás: Söpörj el Extra helyek  /  Szakaszszünetek  /  Minden fejléc  /  Szövegdobozok  /  Hiperhivatkozások  / További eltávolító eszközökért látogasson el a mi oldalunkra Csoport eltávolítása...

Kreatív betétek: Beszúrás Ezer elválasztó  /  Jelölőnégyzetek  /  Rádió gombok  /  QR-kód  /  Vonalkód  /  Átlós vonal táblázat  /  Egyenletfelirat  /  Képfelirat  /  Táblázat felirata  /  Több kép  / Fedezzen fel többet a Csoport beszúrása...

???? Precíziós kiválasztás: Pontosan konkrét oldalak  /  asztalok  /  formák  /  címsor bekezdései  / A navigáció javítása a következővel: több Jelölje ki a funkciókat...

Star Enhancements: Gyorsan navigáljon bármely helyre  /  ismétlődő szöveg automatikus beszúrása  /  zökkenőmentesen válthat a dokumentumablakok között  /  11 Konverziós eszközök...

???? Ki szeretné próbálni ezeket a funkciókat? A Kutools for Word kínál a 60 napos ingyenes próba, korlátozások nélkül! 🚀
 
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