Ok I have quite a few procedures that use the SendObject command.
Heres the problem and should be quite easy for most of you. If I cancell out the Outlook window after it is opened. I get a sendobject error window popup. Is there a simple way to eliminate this?
Use the VB error handler to capture the error or ignore it.
Example: Capture the error and handle it in code
Sub SendMail() On Error GoTo SendMailErr
DoCmd.SendObject acSendQuery, "qTest", , "emailaddr", , , "Test", "Another test."
Exit Sub SendMailErr:
If Err = 2501 Then
Exit Sub
End If
' Additional error handling code here
Resume next
End Sub
Example: Ignore all errors
Sub SendMail() On Error Resume Next
DoCmd.SendObject acSendQuery, "qTest", , "emailaddr", , , "Test", "Another test."
End Sub Terry L. Broadbent FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.