Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Email Sent or Cancelled


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


--
mjamici
------------------------------------------------------------------------
mjamici's Profile: http://www.excelforum.com/member.php...o&userid=24337
View this thread: http://www.excelforum.com/showthread...hreadid=379372

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email Sent or Cancelled

Hi Michael

Only way to be sure is to put your address in the CC


--
Regards Ron de Bruin
http://www.rondebruin.nl


"mjamici" wrote in message
...

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


--
mjamici
------------------------------------------------------------------------
mjamici's Profile: http://www.excelforum.com/member.php...o&userid=24337
View this thread: http://www.excelforum.com/showthread...hreadid=379372



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
Hyperlink operation cancelled.... Kim Excel Discussion (Misc queries) 1 June 15th 07 03:24 PM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM
countif Column A and excule column B if it's cancelled LLWest Excel Worksheet Functions 4 October 31st 06 10:47 PM
program stuck at "Save Cancelled by Operator" MainelyPat Excel Discussion (Misc queries) 3 April 20th 06 06:23 PM


All times are GMT +1. The time now is 08:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"