View Single Post
 
Old 07-31-2022, 04:10 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

For example:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Format = False
    .Forward = True
    .Font.Superscript = True
    .Wrap = wdFindStop
    .MatchWildcards = True
    .Text = "<[0-9]@>"
    .Replacement.Text = ""
  End With
  Do While .Find.Execute = True
    If .Font.ColorIndex <> wdClassicRed Then
      If .Text > i Then i = .Text
    End If
   .Collapse wdCollapseEnd
  Loop
End With
MsgBox i
Application.ScreenUpdating = True
End Sub
Of course, since Word has different versions of 'red' (e.g. wdRed, wdClassicRed, wdDarkRed), you'll need to choose the correct one for testing. And, if it's not one of those 'standard' reds, you'll need to use .Font.Color with the appropriate RGB value.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote