Email Sent or Cancelled

M

mjamici

Please help,

I have some code (see below) to send emails from Excel 2003. I have it
set with .display because the user needs the option to view the email
before sending. My problem is I can't tell if the user sent the email
or closed the window without sending.

I really need to test to see if the email was sent or not. Any ideas?

Thanks in advance,
Michael

Set OutApp = CreateObject("Outlook.Application")
Set outmail = OutApp.CreateItem(0)

With outmail
..To = "" ' Environ("username")
..CC = ""
..BCC = ""
..Subject = ""
..Body = ""
..attachments.Add ActiveWorkbook.FullName
..display
'work around for the Outlook security warning message
Application.Wait (10)
SendKeys "^{Enter}", 5

End With


Set outmail = Nothing
Set OutApp = Nothing
 

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