View Single Post
 
Old 01-28-2021, 01:05 AM
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

Perhaps:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Rng As Range
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "<[A-Z0-9.\-]@[A-Z0-9.\-]@[DE]*>"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
  End With
  Do While .Find.Execute
    Set Rng = .Duplicate
    With Rng
      .End = .Paragraphs(1).Range.End - 1
      .End = .Start + Len(Split(.Text, " ")(0))
      .Collapse wdCollapseEnd
      .End = .Paragraphs(1).Range.End - 1
      If UBound(Split(.Text, " ")) > 1 Then
        If Split(.Text, " ")(1) = "REV" Then .End = .Start + 10
      End If
    End With
    .End = Rng.End
    .Font.Bold = True
    .Collapse wdCollapseEnd
  Loop
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote