Vai al contenuto principale

Come dividere il documento in più documenti in Word?

Se hai un enorme documento word che devi dividere in più documenti, dedica qualche minuto alla lettura di questo tutorial. Questo tutorial ti mostrerà due metodi per dividere un documento in più documenti.


Documento di Word diviso in base al delimitatore specificato con VBA

Invece di dividere manualmente il documento in più documenti, questo metodo introdurrà un VBA per dividere un documento di Word in base al delimitatore specificato in Word. Si prega di fare quanto segue:

1. stampa Alt + F11 i tasti insieme per aprire la finestra Microsoft Visual Basic for Application;

2. Clic inserire > Moduli, quindi incolla sotto il codice VBA nella nuova finestra del modulo di apertura.

VBA: divide il documento di Word in più documenti per delimitatore

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. Quindi fare clic Correre o premere il tasto F5 per applicare il VBA.

4. Nel documento Microsoft Word che viene visualizzato, fare clic sul pulsante Sì per andare avanti.

Nota:
(1) Assicurati di aggiungere il delimitatore come lo stesso di "///" nel sub test al documento tra ogni sezione di testo che desideri separare. Inoltre, puoi cambiare "///" a qualsiasi delimitatore per soddisfare le tue esigenze.
(2) È possibile modificare i documenti "Appunti" nel sub Test per soddisfare le tue esigenze.
(3) E i documenti di divisione verranno salvati nello stesso posto con il file originale.
(4) Non è necessario aggiungere un delimitatore alla fine del file originale, se lo fai, ci sarà un documento vuoto dopo la divisione.

Dividi documento Word per pagina con VBA

Ecco un altro VBA per aiutarti a dividere rapidamente un documento Word in più pagine in Word. Si prega di fare quanto segue:

1. stampa Alt + F11 i tasti insieme per aprire la finestra Microsoft Visual Basic for Application;

2. Clic inserire > Moduli, quindi incolla sotto il codice VBA nella nuova finestra del modulo di apertura.

VBA: dividi il documento in più documenti 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. Quindi fare clic Correre pulsante o premere F5 chiave per applicare il VBA.

Nota: I documenti di divisione verranno salvati nella stessa posizione del file originale.


Dividi il documento Word per intestazione/pagina/interruzione di sezione/interruzione di pagina utilizzando Kutools per Word

Se hai installato Kutools per Word, puoi applicarlo Diviso funzione per dividere facilmente un documento in più documenti per pagina, titolo, interruzione di sezione o interruzione di pagina di cui hai bisogno in Word.

Kutools for Word è il componente aggiuntivo di Word definitivo che semplifica il tuo lavoro e migliora le tue capacità di elaborazione dei documenti. Provalo GRATIS per 60 giorni! Scaricalo ora!

1.Clic Kutools Plus > Diviso per abilitare il Diviso caratteristica.

2. Nella finestra di dialogo Dividi di apertura nella schermata, puoi fare come segue:

(1) Scegli il modo di divisione dal file Dividi per menu `A tendina.
Questa funzione supporta 6 modi di suddivisione: intestazione 1, interruzioni di pagina, interruzioni di sezione, pagine, ogni n pagine e intervalli di pagine personalizzati come mostrato nell'immagine sottostante:

(2) Fare clic su Scopri la nostra gamma di prodotti pulsante  specificare la cartella di destinazione in cui salverai i documenti divisi;

(3) Digitare una parola chiave come prefisso dei nuovi nomi di documenti nel file Prefisso documento scatola.

Suggerimenti:
(1) Se si specifica la divisione del documento corrente per Ogni n pagine, è necessario specificare il numero nel file Ogni n pagine scatola;

(2) Se si specifica di dividere il documento corrente per intervalli di pagine personalizzati, è necessario immettere questi intervalli di pagine personalizzati separati da virgole nel Pagina casella, ad esempio, digitare 1, 3-5, 12 nella casella.

3. Clicca il Ok pulsante per avviare la divisione.

Quindi il documento corrente viene diviso in base al modo di divisione specificato ei nuovi documenti verranno salvati nella cartella di destinazione in blocco.

Navigazione a schede e modifica di più documenti Word come Firefox, Chrome, Internet Explore 10!

Potresti avere familiarità con la visualizzazione di più pagine Web in Firefox/Chrome/IE e passare da una all'altra facendo facilmente clic sulle schede corrispondenti. Qui, Office Tab supporta un'elaborazione simile, che ti consente di sfogliare più documenti Word in una finestra di Word e passare facilmente da uno all'altro facendo clic sulle relative schede. Fare clic per la prova gratuita delle funzionalità complete!
Sfoglia più documenti di parole in una finestra come Firefox


Articoli relativi:


I migliori strumenti per la produttività in ufficio

Kutools for Word - Migliora la tua esperienza con le parole con Over 100 Caratteristiche notevoli!

🤖 Assistente AI di Kutools: Trasforma la tua scrittura con l'intelligenza artificiale - Genera contenuto  /  Riscrivere il testo  /  Riepilogare i documenti  /  Richiedi informazioni sulla base del documento, tutto all'interno di Word

📘 Padronanza dei documenti: Pagine divise  /  Unisci documenti  /  Esporta la selezione in vari formati (PDF/TXT/DOC/HTML...)  /  Converti in batch in PDF  /  Esporta pagine come immagini  /  Stampa più file contemporaneamente...

Modifica dei contenuti: Trova e sostituisci in batch su più file  /  Ridimensiona tutte le immagini  /  Trasporre righe e colonne della tabella  /  Converti tabella in testo...

🧹 Pulito senza sforzo: Spazza via Spazi extra  /  Interruzioni di sezione  /  Tutte le intestazioni  /  Caselle di testo  /  Collegamenti ipertestuali  / Per ulteriori strumenti di rimozione, vai al nostro Rimuovi gruppo...

Inserti creativi: Inserisci Mille separatori  /  Caselle di controllo  /  Pulsanti di scelta  /  QR Code  /  Codice a barre  /  Tabella della linea diagonale  /  Didascalia dell'equazione  /  Didascalia immagine  /  Didascalia  /  Immagini multiple  / Scopri di più nella Inserisci gruppo...

???? Selezioni di precisione: Individuare pagine specifiche  /  con tabelle  /  forme  /  paragrafi di intestazione  / Migliora la navigazione con Scopri di più Seleziona funzionalità...

Miglioramenti delle stelle: Naviga rapidamente verso qualsiasi luogo  /  inserire automaticamente testo ripetitivo  /  passare senza problemi da una finestra all'altra del documento  /  11 strumenti di conversione...

👉 Vuoi provare queste funzionalità? Kutools per Word offre a Prova gratuita 60-day, senza limitazioni! 🚀
 
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