VBA Outlook Mail .display, recording when/if sent manually

Posted by ExcelCyclist on Stack Overflow See other posts from Stack Overflow or by ExcelCyclist
Published on 2010-03-28T13:34:11Z Indexed on 2010/03/29 13:43 UTC
Read the original article Hit count: 415

My code displays a message with basic subject, body, attachment. Next the user manually updates and customizes the message and should send it. I want to record when (if) the email is sent. Is this possible or any tips?

My environment is Office 2007 with an excel based macro going to Outlook.

[Excerpt]

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon

Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
    .To = Email                 '.CC = 
    .Subject = Subj
    .BodyFormat = olFormatHTML
    .Body = Msg                 '.HTMLBody = Msg
    If Not FileAttach = vbNullString Then .Attachments.Add (FileAttach) 
    .Display
End With

© Stack Overflow or respective owner

Related posts about office-2007

Related posts about vba