Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Jerusalem, Israel
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is it possible to find only the latest changes made in a document. For example:

    A colleague sends me version 2 of a document with his updates (tracking on). I then make my corrections and amendments and send it back to my colleague for review. My colleague then returns the document to me with more changes. None of the previous changes were accepted.

    How can I tell which are the new changes and which are the changes I have already reviewed? This is especially important in a large document, as you can imagine.

    Thanks for any help you can offer!

    JoeK

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    [quote name='joek' post='790910' date='27-Aug-2009 18:12']Is it possible to find only the latest changes made in a document.[/quote]
    Every revision has a date property which you could use to show you which ones happened after a certain date. I don't know how you want to handle them but I would take a copy of the file and accept all the older revisions. This will leave you with a document that only contains the recent revisions so you can then look only at those to identify them but your future edits may need to go back in the original version that showed all revisions.
    Code that would do something like this is
    Code:
      Dim aRev As Revision
      For Each aRev In ActiveDocument.Revisions
    	If aRev.Date < Now() - 1 Then
    	  aRev.Accept
    	End If
      Next aRev
    You could also create some code based on this same attribute which takes you to the next revision which is newer than X.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Hi Joe,

    Assuming you're only dealing with changes in the body of the document (ie no headers/footers/textboxes, etc), here's a macro to find the last change:
    Code:
    Sub FindLastChange()
    Dim RevDate As Date
    Dim Rev As Revision
    RevDate = 0
    For Each Rev In ActiveDocument.Revisions
      If Rev.Date > RevDate Then
    	Rev.Range.Select
    	RevDate = Rev.Date
      End If
    Next
    MsgBox RevDate & vbCrLf & Selection.Range.Text
    End Sub
    For something more sophisticated, you could use:
    Code:
    Sub FindLatestChanges()
    Dim RevDate As String
    Dim Rev As Revision
    If ActiveDocument.Revisions.Count = 0 Then
      MsgBox "No Revisions Found", vbExclamation
      End
    End If
    RevDate = InputBox("What is the Date & Time of the last revision to ignore?")
    If IsDate(RevDate) Then
      Selection.EndOf (wdStory)
      For Each Rev In Selection.Range.Revisions
    	If Rev.Date > RevDate Then
    	  Rev.Range.Select
    	  Exit For
    	End If
      Next
      If Selection.Range.Revisions.Count = 0 Then
    	MsgBox "No Later Revisions Found", vbExclamation
    	End
      ElseIf Selection.Range.Revisions(1).Date <= RevDate Then
    	MsgBox "No Later Revisions Found", vbExclamation
    	End
      Else
    	MsgBox "The selected revision occured on " & Rev.Date, vbOKOnly
    	End
      End If
    Else
      MsgBox "Date/Time Entry Error", vbCritical
    End If
    End Sub
    The second version allows you to nominate the date/time from which to start checking and the range to check. As you find each revision, you'll need to resume your search immediately after its end - the code automatically extends the selected range to the end of the current 'story'.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •