Ignore and continue the macro.

S

Steved

Hello from Steved

..Text = "Win*%*%"

If the above line is not found can I put in a statment to ignore so that the
macro can continue. Thankyou.

Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Win*%*%"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
 
J

Jonathan West

The Execute method returns a value - True or False depending on whether the
text was found. You can use this value to branch your code accordingly.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
H

Helmut Weber

Hi Steved,
If the above line is not found
can I put in a statment to ignore so that the
macro can continue. Thankyou.

the macro, as you put it, continues anyway.
 

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