Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2006

Tip: Looking for answers? Try searching our database.

search and delete makro?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric - 03 Apr 2006 08:10 GMT
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
Helmut Weber - 03 Apr 2006 09:55 GMT
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.

Signature

Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000

Eric - 03 Apr 2006 11:43 GMT
Alles gut! :)

/e

> Hi Eric,
>
[quoted text clipped - 14 lines]
> And you might have to do some more cleaning
> of your Doc as a result of the code above.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.