Ir para o conteúdo principal

Como dividir o documento em vários documentos no Word?

Se você tiver um grande documento do Word que precisa ser dividido em vários documentos, reserve alguns minutos para ler este tutorial. Este tutorial mostrará dois métodos para dividir um documento em vários documentos.


Divida o documento do Word por delimitador especificado com VBA

Em vez de dividir o documento em vários documentos manualmente, este método apresentará um VBA para dividir um documento do Word pelo delimitador especificado no Word. Faça o seguinte:

1. pressione Alt + F11 teclas juntas para abrir a janela do Microsoft Visual Basic for Application;

2. Clique inserção > Móduloe, a seguir, cole o código VBA na nova janela de abertura do Módulo.

VBA: Dividir Documento do Word em Vários Documentos por Delimitador

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. Então clique Execute ou pressione a tecla F5 para aplicar o VBA.

4. No documento do Microsoft Word aberto, clique no botão Sim para prosseguir.

Nota:
(1) Certifique-se de adicionar seu delimitador da mesma forma que "///" no subteste ao documento entre cada seção do texto que você deseja separar. Além disso, você pode mudar "///" a quaisquer delimitadores para atender às suas necessidades.
(2) Você pode alterar os documentos "Notas" no sub Teste para atender às suas necessidades.
(3) E os documentos de divisão serão salvos no mesmo local com o arquivo original.
(4) Você não precisa adicionar um delimitador ao final do arquivo original; se o fizer, haverá um documento em branco após a divisão.

Divida o documento do Word por página com o VBA

Aqui está outro VBA para ajudá-lo a dividir rapidamente um documento do Word em vários por página no Word. Faça o seguinte:

1. pressione Alt + F11 teclas juntas para abrir a janela do Microsoft Visual Basic for Application;

2. Clique inserção > Móduloe, a seguir, cole o código VBA na nova janela de abertura do Módulo.

VBA: Divida o Documento em Vários Documentos por Página no 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. Então clique Execute ou pressione F5 chave para aplicar o VBA.

Nota: Os documentos de divisão serão salvos no mesmo local com o arquivo original.


Divida o documento do Word por título/página/quebra de seção/quebra de página usando o Kutools for Word

Se você tiver o Kutools for Word instalado, poderá aplicar seu Split função para dividir facilmente um documento em vários por página, título, quebra de seção ou quebra de página, conforme necessário no Word.

Kutools for Word é o complemento definitivo do Word que agiliza seu trabalho e aprimora suas habilidades de processamento de documentos. Experimente GRATUITAMENTE por 60 dias! Obtê-lo agora!

1.Clique Kutools Plus > Split para habilitar o Split recurso.

2. Na caixa de diálogo de abertura Dividir na tela, você pode fazer o seguinte:

(1) Escolha a forma de divisão do Dividido por lista suspensa.
Este recurso oferece suporte a 6 formas de divisão: título 1, quebras de página, quebras de seção, páginas, a cada n páginas e intervalos de páginas personalizados, conforme a captura de tela abaixo:

(2) Clique no Procurar botão  especificar a pasta de destino na qual você salvará os documentos divididos;

(3) Digite uma palavra-chave como prefixo de novos nomes de documentos no Prefixo do Documento caixa.

Dicas:
(1) Se você especificar a divisão do documento atual por A cada n páginas, você precisa especificar o número no A cada n páginas caixa;

(2) Se você especificar a divisão do documento atual por intervalos de páginas personalizados, será necessário inserir esses intervalos de páginas personalizados separados por vírgulas no Página caixa, por exemplo, digite 1, 3-5, 12 na caixa.

3. Clique no Ok botão para iniciar a divisão.

Em seguida, o documento atual é dividido pela forma de divisão especificada e novos documentos serão salvos na pasta de destino em massa.

Navegação com guias e edição de vários documentos do Word como Firefox, Chrome, Internet Explore 10!

Você pode estar familiarizado com a visualização de várias páginas da web no Firefox/Chrome/IE e alternar entre elas clicando facilmente nas guias correspondentes. Aqui, o Office Tab oferece suporte a processamento semelhante, que permite navegar por vários documentos do Word em uma janela do Word e alternar facilmente entre eles clicando em suas guias. Clique para testar todos os recursos gratuitamente!
Navegue por documentos com várias palavras em uma janela como o Firefox


Artigos relativos:


Melhores ferramentas de produtividade de escritório

Kutools for Word - Eleve sua experiência com palavras com mais 100 Recursos notáveis!

🤖 Assistente de IA do Kutools: Transforme sua escrita com IA - Gerar conteúdo  /  Reescrever texto  /  Resumir documentos  /  Pergunte para obter informações com base no documento, tudo dentro do Word

📘 Domínio de documentos: Páginas divididas  /  Mesclar Documentos  /  Seleção de exportação em vários formatos (PDF/TXT/DOC/HTML...)  /  Conversão em lote para PDF  /  Exportar páginas como imagens  /  Imprima vários arquivos de uma vez...

Edição de conteúdo: Localização e substituição em lote em vários arquivos  /  Redimensionar todas as imagens  /  Transpor linhas e colunas da tabela  /  Converter tabela em texto...

🧹 Limpeza sem esforço: Varrer Espaços extras  /  Quebras de seção  /  Todos os cabeçalhos  /  Caixas de Texto  /  hiperlinks  / Para mais ferramentas de remoção, acesse nosso Remover Grupo...

Inserções criativas: Inserir Mil Separadores  /  Caixas de seleção  /  botões de rádio  /  QR Code  /  Código de barras  /  Tabela de linhas diagonais  /  Legenda da equação  /  Legenda da Imagem  /  Legenda da Tabela  /  Várias fotos  / Descubra mais no Inserir Grupo...

🔍 Seleções de precisão: Identificar páginas específicas  /  tabelas  /  formas  /  parágrafos de título  / Melhore a navegação com mais Selecione recursos...

Aprimoramentos de estrelas: Navegue rapidamente para qualquer local  /  inserir automaticamente texto repetitivo  /  alternar perfeitamente entre janelas de documentos  /  11 ferramentas de conversão...

👉 Quer experimentar esses recursos? Kutools para Word oferece um 60-day free trial, sem limitações! 🚀
 
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