Note: The other languages of the website are Google-translated. Back to English
Autentificare  \/ 
x
or
x
Înregistrare  \/ 
x

or

Cum se împarte documentul în mai multe documente în word?

Dacă aveți un document Word masiv pe care trebuie să îl împărțiți în mai multe documente, luați câteva minute pentru a citi acest tutorial. Acest tutorial vă va arăta două metode pentru împărțirea unui document în mai multe documente.


Împărțiți documentul Word prin delimitator specificat cu VBA

În loc să împartă manual documentul în mai multe documente, această metodă va introduce un VBA pentru a împărți un document Word după delimitatorul specificat în Word. Vă rugăm să faceți următoarele:

1. presa Alt + F11 tastele împreună pentru a deschide fereastra Microsoft Visual Basic pentru aplicație;

2. Clic Insera > Moduleși apoi lipiți mai jos codul VBA în noua fereastră Module de deschidere.

VBA: Împărțiți documentul Word în mai multe documente cu Delimiter

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. Apoi apasa Alerga sau apăsați tasta F5 pentru a aplica VBA.

4. În documentul care apare din Microsoft Word, faceți clic pe butonul Da pentru a continua.

Notă:
(1) Asigurați-vă că adăugați delimitatorul la fel ca „///” în subtestul la documentul dintre fiecare secțiune de text pe care doriți să o separați. De asemenea, puteți schimba „///” oricăror delimitatori pentru a vă satisface nevoile.
(2) Puteți modifica documentele „Note” în sub Test pentru a se potrivi nevoilor dumneavoastră.
(3) Iar documentele divizate vor fi salvate în același loc cu fișierul original.
(4) Nu trebuie să adăugați delimitator la sfârșitul fișierului original, dacă faceți acest lucru, va fi un document gol după împărțire.

Împarte documentul Word de pagină cu VBA

Iată un alt VBA pentru a vă ajuta să împărțiți rapid un document Word în mai multe pagini în Word. Vă rugăm să faceți următoarele:

1. presa Alt + F11 tastele împreună pentru a deschide fereastra Microsoft Visual Basic pentru aplicație;

2. Clic Insera > Moduleși apoi lipiți mai jos codul VBA în noua fereastră Module de deschidere.

VBA: Împărțiți documentul în mai multe documente după pagină în 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. Apoi apasa Alerga sau apăsați F5 tasta pentru a aplica VBA.

Notă: Documentele divizate vor fi salvate în același loc cu fișierul original.


Împarte documentul Word după antet / pagină / secțiune / pauză de pagină cu utilizarea Kutools pentru Word

Dacă aveți instalat Kutools pentru Word, îl puteți aplica Despică funcție pentru a împărți cu ușurință un document în mai multe documente în funcție de pagină, antet, secțiune de secțiune sau întrerupere de pagină, după cum aveți nevoie în Word ..

Kutools pentru Cuvânt este un supliment la îndemână pentru a vă ușura munca și a vă îmbunătăți capacitatea de a procesa documentul Word. Încercare gratuită timp de 60 de zile! Ia-l acum!

1.Clic Kutools Plus > Despică pentru a activa funcția Despică caracteristică.

2. În dialogul de deschidere Split din ecran, puteți face următoarele:

(1) Alegeți modul de divizare din Împărțit de lista verticală.
Această caracteristică acceptă 6 moduri de împărțire: titlul 1, pauzele de pagină, pauzele de secțiune, paginile, fiecare n pagină și intervalele de pagini personalizate, după cum se arată în imaginea de mai jos:

(2) Faceți clic pe Naviga buton  pentru a specifica folderul de destinație în care veți salva documentele împărțite;

(3) Tastați un cuvânt cheie ca prefix al numelor de documente noi în Prefixul documentului cutie.

Sfat:
(1) Dacă specificați împărțirea documentului curent cu La fiecare n pagini, trebuie să specificați numărul în La fiecare n pagini cutie;

(2) Dacă specificați să împărțiți documentul curent pe intervale de pagini personalizate, trebuie să introduceți aceste intervale de pagini personalizate separate prin virgule în Pagină casetă, de exemplu, tastați 1, 3-5, 12 în casetă.

3. clic pe Ok butonul pentru a începe divizarea.

Apoi, documentul curent este împărțit după modul de împărțire specificat, iar documentele noi vor fi salvate în folderul de destinație în bloc.

Navigarea cu file și editarea mai multor documente Word ca Firefox, Chrome, Internet Explore 10!

Este posibil să fiți familiarizați să vizualizați mai multe pagini web în Firefox / Chrome / IE și să comutați între ele făcând clic pe filele corespunzătoare. Aici, fila Office acceptă procesări similare, care vă permit să răsfoiți mai multe documente Word într-o singură fereastră Word și să comutați cu ușurință între ele făcând clic pe filele lor. Faceți clic pentru o versiune completă de încercare gratuită!
Răsfoiți mai multe documente Word într-o singură fereastră ca Firefox


Articole relative:



Instrumente de productivitate Word recomandate

 

Kutools pentru Word - Mai mult de 100 de funcții avansate pentru Word, economisiți-vă 50% timp

  • Operațiile complicate și repetate pot fi efectuate o singură dată în câteva secunde.
  • Inserați mai multe imagini în foldere în documentul Word simultan.
  • Combinați și combinați mai multe fișiere Word din foldere într-unul singur cu comanda dorită.
  • Împărțiți documentul curent în documente separate în funcție de titlu, secțiune de secțiune sau alte criterii.
  • Convertiți fișiere între Doc și Docx, Docx și PDF, colecție de instrumente pentru conversii și selecție obișnuite și așa mai departe ...
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    sudesh srivastava · 5 months ago
    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.
  • To post as a guest, your comment is unpublished.
    Greitens · 1 years ago
    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?
  • To post as a guest, your comment is unpublished.
    dev · 1 years ago
    your code add new blank page in every page
  • To post as a guest, your comment is unpublished.
    Jared Wicklund · 1 years ago
    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
    • To post as a guest, your comment is unpublished.
      Charlotte · 1 years ago
      I've got this error too - Did you get anywhere with it?


      Thanks
      • To post as a guest, your comment is unpublished.
        Jared · 1 years ago
        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!!
  • To post as a guest, your comment is unpublished.
    anjv0000@gmail.com · 2 years ago
    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.
  • To post as a guest, your comment is unpublished.
    Jorge · 2 years ago
    The script saves a two pages document, the second is total blank.

    How to solve this?
    • To post as a guest, your comment is unpublished.
      kellytte · 2 years ago
      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.
      • To post as a guest, your comment is unpublished.
        Lisa · 2 years ago
        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?
  • To post as a guest, your comment is unpublished.
    Maya · 2 years ago
    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?
  • To post as a guest, your comment is unpublished.
    Lisa · 3 years ago
    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?
    • To post as a guest, your comment is unpublished.
      Savvyno · 2 years ago
      I am working on this as well but have not found a way to do it besides manually.
    • To post as a guest, your comment is unpublished.
      Steve · 3 years ago
      Does not work at all for me. Goes through the motions but no documents are saved. Maybe because I am using .DOCX files?
      • To post as a guest, your comment is unpublished.
        Savvy · 2 years ago
        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.
        • To post as a guest, your comment is unpublished.
          Steve · 2 years ago
          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.
      • To post as a guest, your comment is unpublished.
        Steve · 3 years ago
        Maybe something to do with Windows 7 settings? Thoughts from anyone?
  • To post as a guest, your comment is unpublished.
    Fenice · 3 years ago
    Mais comment garder une mise en page complexe (image de fond, marges, etc) ?
    Great but how to keep the lay-out (background image, margins ?)
  • To post as a guest, your comment is unpublished.
    Andrew · 3 years ago
    Can you split the document based on Heading 1 styles as your "delimiter".
    • To post as a guest, your comment is unpublished.
      kellytte · 2 years ago
      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.
      • To post as a guest, your comment is unpublished.
        tsetscc@gmail.com · 1 years ago
        Downloaded fodler doesnt open at all. Waiting for a long time.
  • To post as a guest, your comment is unpublished.
    SHUBAM AWASTHI · 3 years ago
    i need to split the document using page range. for example i wanted to split 1 to 10 page in another document. how i can do it
    • To post as a guest, your comment is unpublished.
      Jennifer Echevarria · 2 years ago
      Hi - i have this same question, any way to do this?
  • To post as a guest, your comment is unpublished.
    raid3n06 · 3 years ago
    like individual merge add ons
    • To post as a guest, your comment is unpublished.
      kelly001 · 3 years ago
      The Split (Document) feature of Kutools for Word can help users to split a Word document by heading 1, page break, section break, or page.
      In addition, Kutools for Word also includes Merge feature to merge multiple Word documents into one.
  • To post as a guest, your comment is unpublished.
    Jason · 3 years ago
    I used the code from the "Split Word Document By Page With VBA" section. How should I amend the code in order to maintain the original header in all of the new files?
  • To post as a guest, your comment is unpublished.
    Erica · 3 years ago
    I used the code from the "Split Word Document By Page With VBA" section. It worked to split the documents out but messed up the formatting - causing what should have been on 2 pages to be on 5 instead. I played around with the code and ended up finding a solution.


    I replaced this line: docSingle.Range.Paste 'paste the clipboard contents to the new document

    with this line: docSingle.Range.PasteAndFormat (wdFormatOriginalFormatting)

    Hope this helps some of you who've had formatting issues.
  • To post as a guest, your comment is unpublished.
    Michal · 4 years ago
    Thanks !

    One question do You have any idea to save all the split documents into PDF ?
  • To post as a guest, your comment is unpublished.
    Tjebbe · 4 years ago
    You just saved me a Sh*t load of time, thanks!
  • To post as a guest, your comment is unpublished.
    Prince · 4 years ago
    Thank you, this was very helpful!
  • To post as a guest, your comment is unpublished.
    Ramin · 4 years ago
    Thanks for the macro code
  • To post as a guest, your comment is unpublished.
    LK · 4 years ago
    I did the VBA Code: split document into multiple documents according to delimiter, it does split the document but unfortunately the graphics are deleted, also formatting. Is there a solution to this?
  • To post as a guest, your comment is unpublished.
    Panos HalfMan · 4 years ago
    Does anyone knows how to change the name of the files after splitting the main one

    I want to change the names according to Header of the file
  • To post as a guest, your comment is unpublished.
    Geo. Kelley · 4 years ago
    Forget it, I tried several times with the letters numbers, which did not work, then I seen it erased my comments.

    Just to note the first code did not work for me, it said it was breaking the document into three sections, but did not.
  • To post as a guest, your comment is unpublished.
    Geo. Kelley · 4 years ago
    I tried the first split document code and it did not work. It said it was breaking it into three sections, but it did not.
    • To post as a guest, your comment is unpublished.
      · 4 years ago
      The first VBA will split the current document by delimiter "///". Did you add the split delimiter "///" in you document?
  • To post as a guest, your comment is unpublished.
    Phil Smith · 5 years ago
    Your macro works [b]REALLY[/b] well, however, I require the split documents to retain their narrow margins and two coluimn layout. More by luck than judgement(!), I managed to achieve this manually and the end result was exactly as I required. I then used the macro recorder but do not have the knowledge of Word VBA to alter the recorded code to achieve this. Can you help? Thanks in advance!
  • To post as a guest, your comment is unpublished.
    David Fuller · 5 years ago
    Too hard for a pensioner to comprehend what happened to the old way I windows seven that program was so easy for us older people to follow.
  • To post as a guest, your comment is unpublished.
    JP · 5 years ago
    Unfortunately, I can't split pages with Kutools. What can I do? I get this error message:

    Informationen über das Aufrufen von JIT-Debuggen
    anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

    ************** Ausnahmetext **************
    System.NotSupportedException: Das angegebene Pfadformat wird nicht unterstützt.
    bei System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
    bei System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
    bei System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
    bei System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
    bei System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
    bei System.IO.Directory.CreateDirectory(String path)
    bei Kutools.FormDocumentSplit.€()
    bei Kutools.FormDocumentSplit.›(Object “, EventArgs ”)
    bei System.Windows.Forms.Control.OnClick(EventArgs e)
    bei System.Windows.Forms.Button.OnClick(EventArgs e)
    bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    bei System.Windows.Forms.Control.WndProc(Message& m)
    bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
    bei System.Windows.Forms.Button.WndProc(Message& m)
    bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  • To post as a guest, your comment is unpublished.
    Diane · 5 years ago
    Very helpful thank you!

    My original document had 'read only' set. This is not transferring into the new documents. Is this possible to add?
    • To post as a guest, your comment is unpublished.
      · 4 years ago
      Kutools for Word does not work for read-only documents.
  • To post as a guest, your comment is unpublished.
    Kotieddy · 5 years ago
    Dear team,
    VBA for Splitting document into multiple single-paged document is working good, but the problem is split documents are not having the table formats.(table formats in master document are not formatted as table in split documents).
    Thanks in advance if i can get the macros, so that tabular formats in master document are not disturbed in split documents
  • To post as a guest, your comment is unpublished.
    Ilya · 6 years ago
    Hello. How I can split .doc not one page per document using these scripts? E.g. 10 or 5 pages per document
  • To post as a guest, your comment is unpublished.
    Dhamo · 7 years ago
    When i try to split document the word document by using the above VB code, Its splitting by removing all the images and inseterd objects.
    • To post as a guest, your comment is unpublished.
      Tom Saylor · 5 years ago
      I'm having a problem similar to Dhamo's. I started with a large file with many embedded content controls. When I split my Word file using the VB code, the content controls were all converted to regular text. Is there any way to split a file without losing the formatting of the original?