PDA

View Full Version : eliciting Revision properties



marcelma
11-14-2010, 12:37 PM
Hello,

I want to ascertain whether a certain character is deleted or inserted. If, however, the character has been revised several times (what VBA doesn't know from the start) I have to use a loop, which is a bit too time-consuming. Does anybody know a more efficient way to get this information? The code I am presently using is listed below:


Dim R_ChrEnv As Range

Set R_ChrEnv = Selection.Range
R_ChrEnv.MoveStart wdCharacter, -2
R_ChrEnv.MoveEnd wdCharacter, 3

V_RevisionsCount = R_ChrEnv.Characters.Item(2).Revisions.Count
For V_Loop = 1 To V_RevisionsCount
V_RevisionsTypeString = V_RevisionsTypeString & R_ChrEnv.Characters.Item(2).Revisions(V_Loop).Type & "|"
If InStr("1|2|", R_ChrEnv.Characters.Item(2).Revisions(V_Loop).Type) Then
V_RevTypeL1 = R_ChrEnv.Characters.Item(2).Revisions(V_Loop).Type
V_RevAuthL1 = R_ChrEnv.Characters.Item(2).Revisions(V_Loop).Author
V_Count = V_Count + 1
End If
Next V_Loop
If V_Count > 1 Then
Stop 'There is more than 1 insertion and/or deletion at this position
End If

Thank you very much in advance,
Marcel