Get a list of a word document reviewers

S

sefi.barsinai

I would like to write a macro that will display a list of the document
reviewers to the macro user for selection. The macro will then be able
to jump to the next revision made by the selected reviewer.
However, i could not find a simple way of getting the list of
reviewers (as appears in the Reviewing tool bar). The only way i could
think of, is walking through all revisions and look for the author of
each one, but this may take tool long.
Any idea?
 
S

Shauna Kelly

Hi

I know of no way to get the information you need from Word's object
model.

In any case, bear in mind that you can have two reviewers with the same
name (but different initials). Word recognizes them as different
reviewers, but interrogating a Revision doesn't help you discover which
is which.

However, the following may help:

'You can get the number of reviewers
?ActiveDocument.ActiveWindow.View.Reviewers.Count

'You can show the revisions of only one reviewer
ActiveWindow.View.Reviewers("Shauna T Kelly ").Visible = True
or
ActiveWindow.View.Reviewers(1).Visible = True

'You can get a reference to the first visible revision
ActiveDocument.Revisions(1)

So you could cycle through a counter from 1 to Reviewers.Count, show
only the revisions by that author, get the first visible revision and
read its Author property for the name of the reviewer.

Only testing in your particular environment could tell whether that is
faster than interrogating every revision.

Be ware, though, that the Revisions collection is very flaky. Do not use
For Each to cycle through the collection. Use a counter. If you make any
changes to a revision, you can expect the collection to change. For
example, in the normal course of events, if you have a collection and
..Count = x, and you delete one of them, you'd expect that .Count now =
x - 1. With the Revisions collection, you can often delete a revision,
and you'll still have x items remaining.

Finally, the macro recorder is very helpful for working with Revisions.
Sometimes what you need is a property of the document, but it's often a
property of the document's ActiveWindow's .View. I have no idea why.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top