I have a document which has Track Changes turned on and contains some revisions. I am trying to have the pages that contain revisions copied to a 2nd document so that the new doc will contain only the pages that have changed. The problem I'm having is that each time through the loop, the code is selecting the first page instead of the page with the change. Here is the code as it stands right now:
Code:
For Each oRevision In oDoc.Revisions
revNum = revNum + 1
oDoc.Activate
'If this page hasn't already been copied (for multiple revisions on single page)
If oRevision.Range.Information(wdActiveEndPageNumber) <> nLastPageNum Then
'Also check that the change is not in the header or footer
If oRevision.Range.StoryType = wdMainTextStory Then
MsgBox (oRevision.Range.Text)
'Add 1 to counter
n = n + 1
ActiveDocument.Bookmarks("\Page").Select
Selection.Copy
oNewDoc.Activate
Selection.EndKey wdStory
Selection.InsertBreak (wdPageBreak)
Selection.PasteAndFormat wdPasteDefault
nLastPageNum = oRevision.Range.Information(wdActiveEndPageNumber)
End If
End If
Next oRevision
The message box is displaying the proper text, but when I get to the Select statement, it keeps selecting the first page instead. What am I doing wrong? Any help would be greatly appreciated.
Chris