Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word VBA Text search with Wildcards

Status
Not open for further replies.

carriepete

Technical User
May 17, 2002
1
US
I'm trying to do a find and replace on an email address in a word doc. I'm able to find everything to the right of the "@", but everytime I use a wildcard on the lefthand side it finds all of the text in the doc before, not just the email address.

With myrange.Find
.ClearFormatting
.MatchCase = False ' doesn't work
.MatchWildcards = True
.Text = "(\@(*.*)>" ' works for right of @
.Text = &quot;<(*\@(*.*)>&quot; ' give all text before email


any assistance would be greatly appreciated....

pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top