#1
|
|||
|
|||
Split a word document
Hi
Can anyone please tell me how to split a single word document into several separated documents? e.g. 100-page doc -> 4 x 25-page docs cheers |
#2
|
|||
|
|||
Simplest method: Make four copies of your document, numbered from 1-4. Then delete the parts from each that you don't need.
|
#3
|
|||
|
|||
But if it's a one thousand page doc, it'll be a messy task.
|
#4
|
|||
|
|||
Charles' suggestion may be messy, but as he points out, it is the simplest.
Trying to find (define parameters, code, test, debug, test again....repeat) some coded solution can be MUCH more messy. Do you have specific parameters? Is it 25, 25, 25, 25? Or 30, 10, 50, 10? Is this a one-off? If it IS a one off, then definitely doing it manually will be faster. Although that depends on so many other factors. Are there headers and footer involved? Quote:
|
#5
|
||||
|
||||
What are the splitting criteria? Just a page count, or are there some other criteria?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Just page count, no specific criteria.
|
#7
|
||||
|
||||
The following macro splits a large document into multi-page blocks, the size of which are determined via an InputBox.
Code:
Sub DocumentSplitter() Dim iCount As Long, iLast As Long, wdDocSrc As Document, wdDocTgt As Document Dim RngSplit As Range, StrDocName As String, StrDocExt As String, DocFmt As Long, Rslt Set wdDocSrc = ActiveDocument With wdDocSrc Rslt = InputBox("The document contains " & .ComputeStatistics(wdStatisticPages) & " pages." _ & vbCr & "What is the page block count for splitting?", "Document Splitter") If Rslt = "" Then Exit Sub Rslt = CLng(Rslt) StrDocName = .FullName StrDocExt = "." & Split(StrDocName, ".")(UBound(Split(StrDocName, "."))) StrDocName = Left(StrDocName, Len(StrDocName) - Len(StrDocExt)) & "_" DocFmt = .SaveFormat On Error Resume Next For iCount = 0 To Int(.ComputeStatistics(wdStatisticPages) / Rslt) If .ComputeStatistics(wdStatisticPages) > Rslt Then iLast = Rslt Else iLast = .ComputeStatistics(wdStatisticPages) End If Set RngSplit = .GoTo(What:=wdGoToPage, Name:=iLast) Set RngSplit = RngSplit.GoTo(What:=wdGoToBookmark, Name:="\page") RngSplit.Start = .Range.Start Set wdDocTgt = Documents.Add(Template:=ActiveDocument.AttachedTemplate.FullName, Visible:=False) With wdDocTgt .Range.FormattedText = RngSplit.FormattedText .SaveAs2 FileName:=StrDocName & iCount + 1 & StrDocExt, FileFormat:=DocFmt, AddToRecentFiles:=False .Close End With RngSplit.Cut Next iCount Set RngSplit = Nothing .Close Savechanges:=False End With Set RngSplit = Nothing: Set wdDocSrc = Nothing: Set wdDocTgt = Nothing End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
split word document based on bookmarks with each new document title of the bookmark | megatronixs | Word VBA | 9 | 09-05-2020 02:29 PM |
How do I see one document map for each half of a split MS WORD 2010 document? | quickwin | Word | 3 | 07-09-2013 10:20 PM |
Split multi-page mail merge document, then name file from letter info. | BriMan83 | Mail Merge | 1 | 04-24-2013 11:35 PM |
Split Screen in Word | Topas | Word | 2 | 05-17-2012 07:27 AM |
Split MailMerge document | agujoa | Mail Merge | 3 | 04-08-2012 11:26 PM |