I have the following code that removes instances of the word 'means' that follow after the bold definition text. However, the macro also removes any additional word 'means' that may be within the same paragraph as normal text. What can I add to the code that would stop this from happening. Thanks
Remove the word means TEST DOC June 2021.docx
Code:
Sub DefMeans()
Dim aRng As Range, aPara As Paragraph
Set aRng = ActiveDocument.Range
For Each aPara In aRng.Paragraphs
Next aPara
With aRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[:;, ^t]{1,5}means[:;, ]{1,5}"
.Replacement.Text = "^t"
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End Sub