Send Object not returning error

  • Thread starter Thread starter S Price
  • Start date Start date
S

S Price

Below is some code I have for a command button. The
problem is I need to know whether the user sent/cancelled
the email. When the user is cancelling the e-mail, it's
not returning an error. Any ideas?

ps. warnings are on

On Error GoTo err_cmdSend_Click

Screen.MousePointer = 11
DoCmd.SendObject acSendNoObject, ,
acFormatTXT, , , , , , True

exit_cmdSend_Click:
Screen.MousePointer = 0
Exit Sub

err_cmdSend_Click:
If Err.Number = 2501 Then
MsgBox "E-mail not sent"
Else
MsgBox Err.Description, vbExclamation, Err.Number
End If
Resume Next
 
I recommend you create a zzFrmEmail Form in which the
email To: Subject: Body: gets displayed and then the user
clicks either the Send or Cancel buttons. Then you know
for sure. Also look into Redemption with sending emails to
Outlook as it makes life much easier and you can do
anything.
 
Back
Top