Thread: [Solved] Wildcards and track changes
View Single Post
 
Old 06-05-2022, 10:27 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You don't need wildcards for this. For example:
Code:
Sub TrackChanges()
Application.ScreenUpdating = False
Dim bTrk As Boolean
With ActiveDocument
  bTrk = .TrackRevisions
  .TrackRevisions = False
  With .Range
    With .Find
      .ClearFormatting
      .Format = False
      .Forward = False
      .Wrap = wdFindStop
      .Text = ""
      .Replacement.Text = ""
      .Font.Underline = True
    End With
    Do While .Find.Execute
      .Font.Underline = False
      .Cut
      ActiveDocument.TrackRevisions = True
      .Paste
      ActiveDocument.TrackRevisions = False
      .Collapse wdCollapseStart
    Loop
  End With
  With .Range
    With .Find
      .ClearFormatting
      .Forward = False
      .Wrap = wdFindStop
      .Font.StrikeThrough = True
    End With
    Do While .Find.Execute
      .Font.StrikeThrough = False
      ActiveDocument.TrackRevisions = True
      .Delete
      ActiveDocument.TrackRevisions = False
      .Collapse wdCollapseStart
    Loop
  End With
  .TrackRevisions = bTrk
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote