Option Explicit
Sub PrintRevisionPagesOnly()
Dim oRange As Word.Range
Dim intPageCount As Integer
Dim var
Dim response
If ActiveDocument.Range.Revisions.Count > 0 Then
intPageCount = _
ActiveDocument.Range.Information(wdNumberOfPagesInDocument)
Selection.HomeKey Unit:=wdStory
On Error Resume Next
For var = 1 To intPageCount
Set oRange = _
ActiveDocument.Range _
(Start:=ActiveDocument.Bookmarks("\page").Start, _
End:=ActiveDocument.Bookmarks("\page").End - 1)
If oRange.Revisions.Count > 0 Then
Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, _
Item:=wdPrintDocumentWithMarkup, Copies:=1, Pages:=""
Selection.GoToNext wdGoToPage
Else
Selection.GoToNext wdGoToPage
End If
Set oRange = Nothing
Next
Else
Select Case ActiveDocument.TrackRevisions
Case False
response = MsgBox("There are no recorded revisions in this " & _
"document. Track Changes is not enabled. Would " & _
"you like to turn Track Changes on?", vbYesNo)
If response = vbYes Then ActiveDocument.TrackRevisions = True
Case True
MsgBox "There are no tracked revisions in this document."
End Select
End If
End Sub
|