global removal of a phrase

  • Thread starter Thread starter Elfego Baca
  • Start date Start date
E

Elfego Baca

I have a very large word document, over 1000 pages. There are over 10,000
phrases within parenthesis that contain the word memo) I would like a macro
that would look for all instances of parenthesis that contains the word
'memo' and removed the entire phrase including the opening and ending
parenthesis. For example I need a macro that would remove the following
groups:
(red sunset memo) (memo san francisco) (edward the great memo), but would
not remove (John Smith explorer)
 
The solution is only slightly different from that to which you asked
yesterday

Sub FindAndDeleteSpecial()
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "\(*<memo>*\)"
Do While .Execute(Forward:=True, _
MatchWildcards:=True) = True
oRng.Delete
Loop
End With
End Sub

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Back
Top