RaineSpencer
Programmer
I am running a nifty word macro, found on this board. If the source merged doc is 1 page per person, the macro adds 1 blank page to each split doc. If the source merged doc is 2 pages per person, the macro adds 2 blank pages at the end of each split doc, and so on. I can't see why it is adding the blank pages. Can anybody see the problem???
TIA --
Raine
******************************************************
Sub SplitApart()
Dim x As Long
Dim sections As Long
Dim doc As Document
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set doc = ActiveDocument
sections = doc.sections.Count
For x = sections - 1 To 1 Step -1
doc.sections(x).Range.Copy
Documents.Add
ActiveDocument.Range.Paste
ActiveDocument.SaveAs (doc.Path & "\" & x & ".doc")
Selection.GoTo What:=wdGoToPage, Which:=wdGoToLast
Selection.Delete
ActiveDocument.Close False
Next x
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
TIA --
Raine
******************************************************
Sub SplitApart()
Dim x As Long
Dim sections As Long
Dim doc As Document
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set doc = ActiveDocument
sections = doc.sections.Count
For x = sections - 1 To 1 Step -1
doc.sections(x).Range.Copy
Documents.Add
ActiveDocument.Range.Paste
ActiveDocument.SaveAs (doc.Path & "\" & x & ".doc")
Selection.GoTo What:=wdGoToPage, Which:=wdGoToLast
Selection.Delete
ActiveDocument.Close False
Next x
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub