+ Reply to Thread
Results 1 to 2 of 2

Email Sent or Cancelled

  1. #1
    Registered User
    Join Date
    06-15-2005
    Posts
    1

    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

  2. #2
    Ron de Bruin
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1