View Single Post
 
Old 06-13-2024, 02:35 PM
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^t"
     .Execute Replace:=wdReplaceAll
     'Bold terms
     .Text = "([A-Z][!^13]@)([^t:])"
     .Replacement.Text = "\1^t"
     .Replacement.Font.Bold = True
     .Execute Replace:=wdReplaceAll
   End With
lbl_Exit:
   Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote