I have below macro for coping all open word docs into a "master" sheet and adding a page break then a blank page after each doc copied.
it works fine, however its adding 2 blank pages at the top of the document when it copies, so my first 2 pages on my master are blank.
I am not sure how to get the first document copied to the first page in the master sheet,
so i can stop getting those 2 blank pages on top.
Any ideas?
thanks
Sub DLS()</SPAN>
Dim i As Integer</SPAN>
Dim strKeepOpen As String</SPAN>
strKeepOpen = ("master.docm")</SPAN></SPAN>
For i = Documents.Count To 1 Step -1</SPAN>
If Documents(i).Name <> strKeepOpen Then Documents(i).Activate</SPAN>
Selection.WholeStory</SPAN>
Selection.Copy</SPAN>
If ActiveDocument.Name <> strKeepOpen Then ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges</SPAN>
Windows("master.docm").Activate</SPAN>
Selection.GoTo wdGoToBookmark, , , "\EndOfDoc"</SPAN>
Selection.PasteAndFormat (wdPasteDefault)</SPAN>
With ActiveWindow.View</SPAN>
.ShowRevisionsAndComments = False</SPAN>
.RevisionsView = wdRevisionsViewFinal</SPAN>
End With</SPAN>
Selection.InsertBreak Type:=wdPageBreak</SPAN>
Selection.InsertNewPage</SPAN>
Next i</SPAN>
End Sub</SPAN>
it works fine, however its adding 2 blank pages at the top of the document when it copies, so my first 2 pages on my master are blank.
I am not sure how to get the first document copied to the first page in the master sheet,
so i can stop getting those 2 blank pages on top.
Any ideas?
thanks
Sub DLS()</SPAN>
Dim i As Integer</SPAN>
Dim strKeepOpen As String</SPAN>
strKeepOpen = ("master.docm")</SPAN></SPAN>
For i = Documents.Count To 1 Step -1</SPAN>
If Documents(i).Name <> strKeepOpen Then Documents(i).Activate</SPAN>
Selection.WholeStory</SPAN>
Selection.Copy</SPAN>
If ActiveDocument.Name <> strKeepOpen Then ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges</SPAN>
Windows("master.docm").Activate</SPAN>
Selection.GoTo wdGoToBookmark, , , "\EndOfDoc"</SPAN>
Selection.PasteAndFormat (wdPasteDefault)</SPAN>
With ActiveWindow.View</SPAN>
.ShowRevisionsAndComments = False</SPAN>
.RevisionsView = wdRevisionsViewFinal</SPAN>
End With</SPAN>
Selection.InsertBreak Type:=wdPageBreak</SPAN>
Selection.InsertNewPage</SPAN>
Next i</SPAN>
End Sub</SPAN>