I've created this macro to underline and bold specific text and number when found in my document.
Is there a way to combine and have the macro underline and bold in only one WITH statement? I may have complicated the macro, but it does work.
Thanks!
PHP Code:
Sub FormatMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "<Life Insurance>"
.Replacement.Text = "^&"
.MatchWildcards = True
.Format = True
.Replacement.Font.Underline = wdUnderlineSingle
.Execute Replace:=wdReplaceAll
End With
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "<2.4.9>"
.Replacement.Text = "^&"
.MatchWildcards = True
.Format = True
.Replacement.Font.Bold = wdBoldSingle
.Execute Replace:=wdReplaceAll
End With
End Sub