Steve said:
How do you trap error messages in Word VBA? I looked on the HELP for
an ONERROR command but could not find it. What is the correct way to
trap errors?
Steve Wylie
Hi Steve,
The Code should look like -
On Error Goto ErrHandle
'Your Code here
ErrHandle:
Msgbox "Your Application Encountered and Error" & Err.number &
Err.Description & Err.Source
Err.clear
Have a look at the Err object and see what can be done (open a form in
VBA and type Err, then highlight and press F1 to get a description).
I normally have a function to handle major errors in the app to which I
pass all the relevant info including preset variables in my Functions
HTH
J