K
KirstieA
Hi all,
I have a 300 page document that i want to save in 100 3 page documents, so
every 3 pages is a separate file.
I have the following macro that does it for each individual page but don't
know how to change it for every 3 pages.
--------------------------------------------------------
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 = "LA Notification - Appointment of Carer"
Docname = "C:\My Documents\Test\Merge\" _
& sName & " " & 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
I have a 300 page document that i want to save in 100 3 page documents, so
every 3 pages is a separate file.
I have the following macro that does it for each individual page but don't
know how to change it for every 3 pages.
--------------------------------------------------------
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 = "LA Notification - Appointment of Carer"
Docname = "C:\My Documents\Test\Merge\" _
& sName & " " & 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