View Single Post
 
Old 06-13-2024, 04:10 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
   Set oRng = ActiveDocument.Range
   With oRng.Find
     .ClearFormatting
     .Forward = True
     .Wrap = wdFindContinue
     .Format = True
     .MatchWildcards = True
     .Replacement.ClearFormatting
      'Get rid of quotes
     .Text = "(" & Chr(34) & ")([A-Z][!^13]@)(" & Chr(34) & ")([^t:])"
     .Replacement.Text = "\2\4"
     .Execute Replace:=wdReplaceAll
     'Bold terms
     .Text = "([A-Z][!^13]@[^t:])"
     .Replacement.Text = "\1"
     .Replacement.Font.Bold = True
     .Execute Replace:=wdReplaceAll
   End With
lbl_Exit:
   Exit Sub
End Sub
Reply With Quote