Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jun 2005
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selecting revisions - stuck in table (WordXP)

    Attached is a document that I am running some code on to select each revision individually. However, there is no way I can programmatically select the last revisions in the document. If I count the revisions, it shows that there are 20. However, I cannot use the "Activedocument.revisions(x).range.select" to select any of the last revisions. It seems to be stuck in the earlier revisions in the first table. Can anyone help?
    Attached Files Attached Files

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

    Re: Selecting revisions - stuck in table (WordXP)

    Hi C,

    I think .Revisions.Count gets confused by the revisions in the tables. Nevertheless, the following code does process all revisions:

    Sub TestRev()
    With ActiveDocument
    For x = .Revisions.Count To 1 Step -1
    MsgBox .Revisions.Item(x).Range
    Next
    End With
    End Sub

    As you'll see if you run the code, you get lots of spurious prompts as each revision is processed multiple times. A better approach would be:

    Sub TestRevs()
    With ActiveDocument
    For Each Rev In .Revisions
    MsgBox Rev.Range
    Next Rev
    End With
    End Sub

    This correctly identifies 5 revisions, which is how many you get via Accept/Reject Tracked Changes.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    Star Lounger
    Join Date
    Jun 2005
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting revisions - stuck in table (WordXP)

    Thanks MacroPod. The code shows there are 13 revisions. It works very well.

    The Reviewing Toolbar also seems to get confused by the tables. If I click the "Next" button on it, it gets stuck in the tables.

Posting Permissions

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