search and delete makro?

E

Eric

Kind embarrassing, but if I want to search for () and delete the parenthesis
and everyting in between, ie if I have something like "(bla bla bla)", I
want to delete both the left and right parenthesis and the text in between.
Smartest way to do that?

Any input appreciated.

/d
 
H

Helmut Weber

Hi Eric,

Sub test0987()
Dim rDcm As Range
Set rDcm = ActiveDocument.Range

With rDcm.Find
.Text = "\(*\)"
.MatchWildcards = True
.Replacement.Text = ""
.Execute Replace:=wdReplaceAll
End With
End Sub

But think, whether this is really what you want.

And you might have to do some more cleaning
of your Doc as a result of the code above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top