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 cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catching errors 2

Status
Not open for further replies.

TyP

Computer
Joined
Mar 22, 2006
Messages
3
Location
RU
Hi! I need help!

How to catch an error in Visual Basic for Word2000? Is there any constructions like Try...Catch...Finally?

P.S. I need to find out whether the file exist.
 
Hi TyP,

A couple of options, under the Tools->Options pull-down, under the General tab, in the section marked Error Trapping, you can set it to Break on All Errors, or you can create your own error trapping with an:
Code:
On Error GoTo errHandler

...
..

errHandler:
..
.

HTH
Todd
 
Don't forget to put an Exit Sub above the errHandler: or you'll run the errHandler every time at the end of your procedure.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
2 TCARPENTER1 & joerd:
Thank you so much! I have done it! And it works (:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top