Sorry to jump into an old thread, but I tried out this solution and ran into a problem where the Word document is showing "simple" markup for the tracked changes (ie, just a line on the side of the text) even though it's in "All Markup" mode (which should be underlining the edited text). So it looks like this:
unnamed.png
The second and third lines were originally red. As you can see, they've successfully turned black, but they're not underlined the way tracked changes normally work. I've double-checked and confirmed that I'm in "All Markup" mode and not "Simple Markup," and I'm at a loss - does anyone know why the Simple Markup line is showing instead?
Despite my user settings, the computer I'm trying to do this on is running Windows 11 and using Office 365.
Edit: This was meant to be in response to the solution provided by Guessed:
Quote:
Originally Posted by Guessed
The Execute ReplaceAll command doesn't track the formatting change so you need to loop that step.
Code:
Sub Macro1()
Dim aRng As Range, aRng2 As Range
ActiveDocument.TrackRevisions = True
ActiveDocument.TrackFormatting = True
Set aRng = Selection.Range
Set aRng2 = aRng.Duplicate
With aRng.Find
.ClearFormatting
.Font.Color = wdColorRed
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute = True
aRng.Font.ColorIndex = wdBlack
aRng.End = aRng2.End
Loop
End With
End Sub
|