Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross 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
Mar 22, 2006
3
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.
 
Replies continue below

Recommended for you

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