View Single Post
 
Old 07-06-2022, 11:50 AM
gmaxey gmaxey is online now Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

That is because we didn't search in the footnote or endnote story ranges. It also wouldn't find the formatted text in textboxes, headers or footers, comments etc.


Note: Your macros are not processing "real" endnotes.


To search in footnotes and "real" endnotes modify as follows:

Code:
Sub ClearRed1()
Dim oRng As Range
ActiveDocument.TrackRevisions = True
  Selection.Find.ClearFormatting
  Set oRng = ActiveDocument.Range
  With oRng.Find
    With .Font
      .StrikeThrough = True
      .DoubleStrikeThrough = False
      .Color = wdColorRed
    End With
    While .Execute
      oRng.Delete
    Wend
  End With
  On Error Resume Next
  Set oRng = ActiveDocument.StoryRanges(wdFootnotesStory)
  With oRng.Find
    With .Font
      .StrikeThrough = True
      .DoubleStrikeThrough = False
      .Color = wdColorRed
    End With
    While .Execute
      oRng.Delete
    Wend
  End With
  Set oRng = ActiveDocument.StoryRanges(wdEndnotesStory)
  With oRng.Find
    With .Font
      .StrikeThrough = True
      .DoubleStrikeThrough = False
      .Color = wdColorRed
    End With
    While .Execute
      oRng.Delete
    Wend
  End With
  On Error GoTo 0
  ActiveDocument.TrackRevisions = False
lbl_Exit:
  Exit Sub

End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote