View Single Post
  #2   Report Post  
Graham Mayor
 
Posts: n/a
Default

There is no concept of 'page' in Word, so how easy this will be will be
determined by what is on the pages. If, for example it is a merge document,
see http://www.gmayor.com/individual_merge_letters.htm.
However, if the document is simple ie it does not contain graphics, headers,
sections etc which may screw things up, the following should work

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"
'************************************************* *****
'Change path in the next line
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

You should work on a *copy* of the original document and you'll need to
change the path to suit your requirements. See
http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Mike wrote:
I have a 50 page document that I want to split up into 50
individual word files. Is there a quick way to do this or
will I have to copy and paste and save each page
seperately. Its a project I have to do this week. Not in a
hurry to do it. Any help appreciated.