Split a multi-page file

K

KirstieA

Hello All,

Can anyone tell me if there is a way to split a multi-page file up and save
each individual page?

I don't hold out much hope, but never mind....

TIA,

Kirstie
 
T

TF

There is a way and I am racking my brains trying to remember exactly how.
I'm sure that a fellow MVP said to use MasterDocs to split up a document so
that each page is a separate file. This is about the only time ever to
recommend using MasterDocs because it is a sure fire way of corrupting a
document beyond redemption: so make sure to try it with a copy of the
document!



: Hello All,
:
: Can anyone tell me if there is a way to split a multi-page file up and
save
: each individual page?
:
: I don't hold out much hope, but never mind....
:
: TIA,
:
: Kirstie
:
:
 
S

Suzanne S. Barnhill

I think there's a Splitter macro that Doug Robbins wrote floating around. A
Google Groups search might turn it up.
 
G

Graham Mayor

The code in question is shown below - change the path in the Docname string
to the path you wish to save the files to.

Sub SplitByPage()

Dim mask As String
Letters = ActiveDocument.Bookmarks("\page").Range
mask = "ddMMyy"

Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < Letters
Application.ScreenUpdating = False
sName = "Split"
Docname = "D:\My Documents\Test\Merge\" _
& sName & " " & Format(Date, mask) & " " & LTrim$(Str$(Counter))
On Error GoTo oops:
ActiveDocument.Bookmarks("\page").Range.Cut
Documents.Add
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
ActiveDocument.SaveAs FileName:=Docname, _
FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend
oops:
End Sub


See http://www.gmayor.com/installing_macro.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top