
If authNew authMain And rngRevNew.InRange(rngRevOld) Then 'of the main author and must be rejected. 'this means his revision has replaced that 'and his revision is in the same range as the previous 'If the current revision is not the main author 'If the authors are the same there's no conflict If rngRevNew.Start - rngRevOld.End authMain Then 'whether the next revision (insertion for a deletion, for example) 'The last revision was rejected, so we need to check 'or Deletion have been made prior to this 'There's only something to compare if an Insertion If rev.Type = wdRevisionInsert Or wdRevisionDelete Then Sub CompareRevisionsRanges()ĭim rev As word.Revision, revOld As word.Revisionĭim rngRevNew As word.Range, rngRevOld As word.Rangeĭim authMain As String, authNew As String, authOld As String

#WORD FOR MAC TRACK CHANGES CODE#
Then, the code you already have would run after this code has finished. If that's the case, the new current revision is also rejected. On looping, if a revision was just rejected, the code checks whether the new current revision is by an author that is not the main author AND is immediately adjacent to the previous rejection. OR, if the author of the previous revision is not the main author and the previous revision is in the same range as the current one, then the previous one has replaced a revision by the main author, then the previous revision is rejected. In this case, the current revision is rejected. If they're not the same, then it checks whether the current author is not the main author and whether the current revision is in the same range as the previous, meaning it has "overwritten" a revision by the main author.

If it is and no rejection immediately preceded this part of the loop, then it checks whether the current author was also the author of the previous revision, as there can be no conflict if they're the same. The following VBA code loops through a collection of Revisions, checks whether the Revision is an insertion or deletion. So I want the updated macro to work so that Figure 2-C is same as Figure 1-C. 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.Īs you can see, Figure 2-C differs from Figure 1-C. 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): 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. Here is an example of how the macro works (properly) when the text is edited by one author. 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). The above macro, instead of removing it, transforms it into the crossed out text which my colleagues mistakenly think was present in the original.
:max_bytes(150000):strip_icc()/001_enable-track-changes-word-for-mac-3540065-ad388f75d0964b7d9c94d445bd4c191a.jpg)
In this case, the second author may delete the addition by the first author (not the original text). The problem starts when another person edits the already edited document. MsgBox ("Unexpected Change Type Found"), vbOKOnly + vbCriticalĬ ' move insertion point

MsgBox "There are no revisions in this document", vbOKOnlyįor Each chgAdd In ActiveDocument.RevisionsĬ = wdColorDarkBlueĮlseIf chgAdd.Type = wdRevisionInsert Then The following macro works if only one person edited the Word document. 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.
#WORD FOR MAC TRACK CHANGES SOFTWARE#
I am required to subject MS Word documents to a third-party software which does not recognize the "track changes" markup.
