Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Send Method Error Trapping (2003 SP2)

    I use VBA (from within Access) to create and send e-mail via Outlook. If the user's Outlook "message store" is full, an error is generated when the .Send method is executed (see attachment).

    I've tried to trap this error to provide a more legible notification to the user (using On Error Goto Send_Error, etc.) but this error doesn't seem to trigger the trapping routine. Is there another way to trap this error or am I do something wrong trapping it this way?

    Thanks.
    Attached Images Attached Images

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Send Method Error Trapping (2003 SP2)

    If you get an error message such as the one you attached, error handling can't be active at the moment the error occurs. You wouldn't get a Debug option if error handling was active.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send Method Error Trapping (2003 SP2)

    Hans,

    The line of code immediately preceding objMailItem.Send is On Error Goto Send_Error, so I think error handling is active, unless I'm overlooking something fundamental regarding error handling...

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Send Method Error Trapping (2003 SP2)

    What is the setting in the Error Trapping section in the General tab of Tools | Options... in the Visual Basic Editor? It should be set to "Break on Unhandled Errors", not to "Break on All Errors". If it is set to "Break on Unhandled Error" I don't think there is any way you can trap the built-in error message.

  5. #5
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send Method Error Trapping (2003 SP2)

    Hans,

    Yes, it is set to "Break on Unhandled Errors". So I guess it can't be trapped... (Does the huge negative error number indicate that it's a "built-in" error?)

    Thanks for your help.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Send Method Error Trapping (2003 SP2)

    That the error number is negative doesn't mean much. Programmers are free to choose the error numbers reported by their application.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Send Method Error Trapping (2003 SP2)

    Without seeing your code, this is just a guess. Could this be the second time that error handler is supposed to be called? If an error handler is called and then execution continues without resetting the error handler, it will not be called the second time. To reset error handling, use one of the Resume statements rather than, for example, a GoTo statement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •