I am required to subject MS Word documents to a third-party software which does not recognize the "track changes" markup. But I still need to keep the crossed out text and the newly added text so that my colleagues know what was the original version and what is the change.
The following macro works if only one person edited the Word document.
Sub Macro1()
Dim chgAdd As Word.Revision
If ActiveDocument.Revisions.Count = 0 Then
MsgBox "There are no revisions in this document", vbOKOnly
Else
ActiveDocument.TrackRevisions = False
For Each chgAdd In ActiveDocument.Revisions
If chgAdd.Type = wdRevisionDelete Then
chgAdd.Range.Font.StrikeThrough = True
chgAdd.Range.Font.Color = wdColorDarkBlue
chgAdd.Reject
ElseIf chgAdd.Type = wdRevisionInsert Then
chgAdd.Range.Font.Color = wdColorRed
chgAdd.Accept
Else
MsgBox ("Unexpected Change Type Found"), vbOKOnly + vbCritical
chgAdd.Range.Select ' move insertion point
End If
Next chgAdd
End If
End Sub
The problem starts when another person edits the already edited document. In this case, the second author may delete the addition by the first author (not the original text). The above macro, instead of removing it, transforms it into the crossed out text which my colleagues mistakenly think was present in the original.
I would like to only convert deleted original text to crossed out text, but not the deleted edit (edit by one author deleted by another author).
Here is an example of how the macro works (properly) when the text is edited by one author.
In "C" you can see that the dark blue crossed out text is what has been deleted from the original text, and red is what has been added.
Now let's look what happens when the text has been edited by two (or theoretically more) different editors, with the macro run at the end (not inbetween):
The problem becomes evident here in "C": The word "plantes" became dark blue crossed out text even though it was not part of the original text.
As you can see, Figure 2-C differs from Figure 1-C. So I want the updated macro to work so that Figure 2-C is same as Figure 1-C.