Revision Collection Revisited

G

George Lee

I want to look at the revision status of selected text. After selecting the
text:

myString = Selection.Range.Text 'selection is not the entire document
Selection.Range.Revisions.Count

reports the correct text and does return a count. However,
Selection.Range.Revisions(1) always returns the first change in the document,
not the selection. Neither can I get an index for the selection value.

What am I overlooking? How do I get the revision status on the selected text?
 
J

Jean-Guy Marcil

George Lee was telling us:
George Lee nous racontait que :
I want to look at the revision status of selected text. After
selecting the text:

myString = Selection.Range.Text 'selection is not the entire
document Selection.Range.Revisions.Count

reports the correct text and does return a count. However,
Selection.Range.Revisions(1) always returns the first change in the
document, not the selection. Neither can I get an index for the
selection value.

What am I overlooking? How do I get the revision status on the
selected text?

What Word version?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
G

George Lee

Word 2000. Does version matter?

Jean-Guy Marcil said:
George Lee was telling us:
George Lee nous racontait que :


What Word version?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jean-Guy Marcil

George Lee was telling us:
George Lee nous racontait que :
Word 2000. Does version matter?

Could have mattered, as it does in some cases.

I asked because my initial test with 2003 did not produce the results you
observed.

I have just tried

myRevCount = Selection.Range.Revisions.Count
Selection.Range.Revisions(1).Range.Select
myRevIndex = Selection.Range.Revisions(1).Index

in Word 2000 and everything works as expected.

Are you doing something else in your code?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
G

George Lee

As a follow up, the problems were instances within tables. I have seen some
posts stating the revision marks in tables caused problems. Can this be
confirmed?

As a workaround, I converted all tables to text. That kept the revision
information I needed. However this may not be practical for all instances.
 
J

Jean-Guy Marcil

George Lee was telling us:
George Lee nous racontait que :
As a follow up, the problems were instances within tables. I have
seen some posts stating the revision marks in tables caused problems.
Can this be confirmed?

Yes, with tables it is tricky. You have the same problem when you try to use
a formula that refers to a column range.

The problem lies with the fact that when you have a range in a table that
does not include cells to the left (or right in this case) of the target
range, Word includes them anyway.
For example, you have a 5x5 table, you select the (2-row,2-col,)Cell as a
starting point and (4,4)Cell as an end point. You have 4 revisions in that
range of 9 cells. Let's say that you have a revision in the (3,1)Cell.
myRevCount = Selection.Range.Revisions.Count
will report 5 revisions because Word includes all the cells in all rows that
are selected, even if those cells were not selected in the initial range.

I do not know of a work around

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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