Reply
 
Thread Tools Display Modes
  #1   Report Post  
 
Posts: n/a
Default Find most recent addition

Using Word 97 with Track Changes enabled on a very long document, is
there a quick way to find the most recent addition or an addition made
on a known date?

Sorry if this double posted - can't find previous similar post

  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default Find most recent addition

On 14 Nov 2005 14:14:39 -0800, wrote:

Using Word 97 with Track Changes enabled on a very long document, is
there a quick way to find the most recent addition or an addition made
on a known date?

Sorry if this double posted - can't find previous similar post


Here are two macros, one for each request. If you need instructions
for installing a macro in a template, see
http://www.gmayor.com/installing_macro.htm.

The first macro lists the revisions in the document by putting their
dates and page/line numbers in a table in a new document, and sorting
the table. The most recent revisions will be at the end of the table.
Word records the times only to the nearest minute, so there may be
several revisions shown as the same time and it may no be possible to
tell which one was made last.

Sub RevisionsByDateTime()
Dim srcDoc As Document, destDoc As Document
Dim oRev As Revision
Dim oTbl As Table
Dim nRows As Long

Set srcDoc = ActiveDocument
Set destDoc = Documents.Add
destDoc.Sections(1).Headers(wdHeaderFooterPrimary) _
.Range.Text = "Revisions in " & _
srcDoc.FullName

Set oTbl = destDoc.Tables.Add(Range:=destDoc.Range, _
numrows:=1, numcolumns:=3)
nRows = 1
With oTbl
.Cell(1, 1).Range.Text = "Date & Time"
.Cell(1, 2).Range.Text = "Page"
.Cell(1, 3).Range.Text = "Line"

For Each oRev In srcDoc.Revisions
.Rows.Add
nRows = nRows + 1
.Cell(nRows, 1).Range.Text = _
oRev.Date
.Cell(nRows, 2).Range.Text = oRev.Range.Information( _
wdActiveEndAdjustedPageNumber)
.Cell(nRows, 3).Range.Text = oRev.Range.Information( _
wdFirstCharacterLineNumber)
Next oRev

.Rows(1).HeadingFormat = True
.Sort excludeheader:=True, fieldnumber:=1, _
sortfieldtype:=wdSortFieldDate
End With
End Sub

The second macro lets you specify a date, and then lists the revisions
that were made on that date.

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(Left$(Format(oRev.Date, "MM/dd/yyyy"), 10)) _
= 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
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] shivakumar.sokke@gmail.com is offline
external usenet poster
 
Posts: 1
Default Find most recent addition

On Tuesday, 15 November 2005 03:44:39 UTC+5:30, wrote:
Using Word 97 with Track Changes enabled on a very long document, is
there a quick way to find the most recent addition or an addition made
on a known date?

Sorry if this double posted - can't find previous similar post


Thanks Jay

Is it possible to have tow more columns added along with Page, line say What was the original Text and What is the final text.

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] dpkreil@gmail.com is offline
external usenet poster
 
Posts: 1
Default Find most recent addition

Not entirely what you're asking for but I find that the below gives me the additional info I require. Also note the two additional revision types.
Best displayed in a 'landscape' document...


Sub RevisionsByDateTime()
' source: https://groups.google.com/forum/?hl=...M/A_oF4CbMiCEJ
Dim srcDoc As Document, destDoc As Document
Dim oRev As Revision
Dim oTbl As Table
Dim nRows As Long

Set srcDoc = ActiveDocument
Set destDoc = Documents.Add
destDoc.Sections(1).Headers(wdHeaderFooterPrimary) _
.Range.Text = "Revisions in " & _
srcDoc.FullName

RevType = Array("NoRevision", "Insert", "Delete", _
"Property", "ParagraphNumber", "DisplayField", _
"Reconcile", "Conflict", "Style", "Replace", _
"ParagraphProperty", "TableProperty", _
"SectionProperty", "StyleDefinition", "MovedFrom", "MovedTo")

Set oTbl = destDoc.Tables.Add(Range:=destDoc.Range, _
numrows:=1, numcolumns:=5)
nRows = 1
With oTbl
.Cell(1, 1).Range.Text = "Date & Time"
.Cell(1, 2).Range.Text = "Pg Ln"
.Cell(1, 3).Range.Text = "Author"
.Cell(1, 4).Range.Text = "Type"
.Cell(1, 5).Range.Text = "Text"

For Each oRev In srcDoc.Revisions
.Rows.Add
nRows = nRows + 1
.Cell(nRows, 1).Range.Text = _
oRev.Date
.Cell(nRows, 2).Range.Text = oRev.Range.Information( _
wdActiveEndAdjustedPageNumber) & " " & _
oRev.Range.Information(wdFirstCharacterLineNumber)
.Cell(nRows, 3).Range.Text = oRev.Author
.Cell(nRows, 4).Range.Text = RevType(oRev.Type)
.Cell(nRows, 5).Range.Text = oRev.Range.Text
Next oRev

.Rows(1).HeadingFormat = True
.Sort excludeheader:=True, fieldnumber:=1, _
sortfieldtype:=wdSortFieldDate
End With
End Sub
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding most recent addition to document [email protected] Microsoft Word Help 2 November 15th 05 11:00 AM
find excel recent saved file but i also saved it on home computer, sonia New Users 2 September 16th 05 06:09 AM
Find and Replace GREEK symbols in XP, 2K & 97 Jazz Microsoft Word Help 3 April 8th 05 08:13 PM
Find & Replace does not find formatting Ed Microsoft Word Help 5 April 1st 05 12:33 AM
Find and Replace anomaly BruceM Microsoft Word Help 7 January 18th 05 05:47 PM


All times are GMT +1. The time now is 08:28 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"