L
LordTel
I am running word 2002 SP3 and am experiencing strange behaviour in some
documents running VBA code with track changes. The anomaly is not consistent
but when you get a document that displays the behaviour it is then solid.
If I have track changes on and then select an area of a document at the end
of the document (though it does not necessarily need to include the end of
document itself) and make a change to this text, e.g. change the before and
after paragraph spacing.
If i am then running VBA code (to try to gauge if the cursor is currently in
a revision before I move it) from a macro that references an item in the
revision collection Word throws up a dialogue "Word has finished searching
the document. Do you want to continue searching from the beginning of the
document?"
The offending section in the VBA would be something like
MsgBox (Selection.range.Revisions.Count)
MsgBox (Selection.range.Characters(1).Revisions.Count)
MsgBox (Selection.range.Characters(1).Revisions(1).Type)
The first two lines will display the number 1, indicating that there is a
revision at the insertion point. the third statement will bring up the
message box mentioned above and then a VB error box: 5941 - Requested member
of the collection does not exist.
if the insertion point is within a revision that was made and marked prior
to the paragraph spacing change then the code behaves correctly (though
reports two revisions at the insertion point and if I try to reference
..revisions(2) it exhibits the same behaviour).
any thoughts?
documents running VBA code with track changes. The anomaly is not consistent
but when you get a document that displays the behaviour it is then solid.
If I have track changes on and then select an area of a document at the end
of the document (though it does not necessarily need to include the end of
document itself) and make a change to this text, e.g. change the before and
after paragraph spacing.
If i am then running VBA code (to try to gauge if the cursor is currently in
a revision before I move it) from a macro that references an item in the
revision collection Word throws up a dialogue "Word has finished searching
the document. Do you want to continue searching from the beginning of the
document?"
The offending section in the VBA would be something like
MsgBox (Selection.range.Revisions.Count)
MsgBox (Selection.range.Characters(1).Revisions.Count)
MsgBox (Selection.range.Characters(1).Revisions(1).Type)
The first two lines will display the number 1, indicating that there is a
revision at the insertion point. the third statement will bring up the
message box mentioned above and then a VB error box: 5941 - Requested member
of the collection does not exist.
if the insertion point is within a revision that was made and marked prior
to the paragraph spacing change then the code behaves correctly (though
reports two revisions at the insertion point and if I try to reference
..revisions(2) it exhibits the same behaviour).
any thoughts?