![]() |
|
#2
|
||||
|
||||
|
Try something along the lines of:
Code:
Sub Splitter()
Dim DocSrc As Document, DocTgt As Document, i As Long, j As Long, Rng As Range, StrTgt As String
Set DocSrc = ActiveDocument
With DocSrc
Set Rng = .Range(0, 0): j = 1000: StrTgt = Split(.FullName, ".doc")(0) & "_"
For i = 1 To -Int(-.ComputeStatistics(wdStatisticWords) / j)
If .Range(Rng.Start, .Range.End).ComputeStatistics(wdStatisticWords) < j Then _
j = .Range(Rng.Start, .Range.End).ComputeStatistics(wdStatisticWords)
If j = 0 Then Exit For
With Rng
.MoveEnd wdWord, j
.End = .Paragraphs.Last.Range.End
Do While .ComputeStatistics(wdStatisticWords) < j
.MoveEnd wdParagraph, wdForward
Loop
Set DocTgt = Documents.Add(Template:=DocSrc.AttachedTemplate.FullName, Visible:=False)
With DocTgt
.Range.FormattedText = Rng.FormattedText
.SaveAs2 StrTgt & i & ".docx", FileFormat:=wdFormatXMLDocument, AddToRecentFiles:=False
.Close False
End With
.Collapse wdCollapseEnd
If .End = DocSrc.Range.End Then Exit For
End With
Next
End With
End Sub
Any document you run the code on will be split into ~1000 word segments. It's a once-off exercise, though and, if you need to make further splits, re-running the macro will simply regenerate the previous splits (subject to any edits you've made there). For PC macro installation & usage instructions, see: Installing Macros For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to find (highlight) two and more words in a list of 75k single words in Word 2010 | Usora | Word | 8 | 05-29-2018 03:34 AM |
Problem with words splitting into 2 lines
|
sharkrfish | Word | 2 | 05-21-2015 04:47 PM |
| Redirect mail in batches in Office for MAC 2011 | mervalong | Outlook | 0 | 11-08-2011 12:17 AM |
Help Splitting and images in word 2007.
|
aligahk06 | Drawing and Graphics | 1 | 10-08-2009 12:58 AM |
WORD 2003 Need help splitting a HUGE Document
|
dlawson | Word | 4 | 04-14-2009 12:22 PM |