View Single Post
 
Old 07-25-2019, 02:53 PM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub Demo()
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .ClearFormatting
    .Text = "(^0147)([A-Z]*)([^0148])"
    .MatchWildcards = True
    While .Execute
      oRng.Start = oRng.Start + 1
      oRng.End = oRng.End - 1
      oRng.Style = ActiveDocument.Styles("Strong") 'replace with your style
      oRng.Collapse wdCollapseEnd
    Wend
  End With
lbl_Exit:
  Exit Sub
End Sub
Reply With Quote