View Single Post
  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default

TechWriter wrote:
I have a document, which has undergone zillions of change. The
document is around 200 pages long. Each change has been tracked with
the help of the Track Change option.

Is there anyway to know what change was made on a specific date. I
don't want to browse through the whole document, placing the mouse
pointer on each paragraph to know when it was changed.

Thanks in advance.


This macro may be a bit of overkill, but try it anyway. :-) It asks for the
date, then creates a separate document with a list of the revisions that
happened on that date (only the page number, line number, and revision
type). Then you can use the GoTo command (Ctrl+G) in the original document
to jump to that location.

Sub TrackByDate()
Dim srcDoc As Document, destDoc As Document
Dim oRev As Revision
Dim strCkDate As String
Dim CkDate As Date
Dim RevType As Variant
RevType = Array("NoRevision", "Insert", "Delete", _
"Property", "ParagraphNumber", "DisplayField", _
"Reconcile", "Conflict", "Style", "Replace", _
"ParagraphProperty", "TableProperty", _
"SectionProperty", "StyleDefinition")

strCkDate = InputBox$("Enter date:")
If strCkDate = "" Then Exit Sub
If Not IsDate(strCkDate) Then Exit Sub

CkDate = CDate(strCkDate)

Set srcDoc = ActiveDocument
Set destDoc = Documents.Add
destDoc.Range.Text = "Revisions in " & _
srcDoc.FullName & " on " & strCkDate & _
vbCr & "Page" & vbTab & "Line" & vbCr & vbCr

For Each oRev In srcDoc.Revisions
If CDate(CLng(oRev.Date)) = CkDate Then
destDoc.Range.InsertAfter _
oRev.Range.Information( _
wdActiveEndAdjustedPageNumber) & _
vbTab & oRev.Range.Information( _
wdFirstCharacterLineNumber) & _
vbTab & RevType(oRev.Type) & vbCr
End If
Next oRev
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org