Script always faulting

N

Norm

I've written a VBA script that will run every time a message is
received that will examine the message for attachments, and if it
contains a certain attachment that my ISP includes if it thinks the
message is spam, and if it does, it removes the attachments and moves
that message to a *spam* folder.

This script is complete with an error handling routine which causes
the script to exit at the first sign of an error. I use Debug.Print
at various places to see where a problem might be as it's running.

It works perfectly for messages with no attachments, and it even works
as expected for half the massages that do contain the relevant
attachment. But for the other half, I'll get an error statement on
the screen that says that the script faulted. At that point, the
script never runs again because the fault message stays on the screen
until I press OK, and even if I'm there to do that, OL disables the
script.

So my questions are these........

1) How can the script fault when the first line is an *On Error*
error trapping line?
2) Why does the script work sometimes, and not others?
3) Why does it always work if I run the script manually on the very
message that caused it to fault when the message first arrived?
 
S

Sue Mosher [MVP-Outlook]

What is the specific error message?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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