Send a flag from Outlook 2013 to Access 2013 confirming that email was sent (exists i

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drnorbert
    New Member
    • Aug 2015
    • 1

    Send a flag from Outlook 2013 to Access 2013 confirming that email was sent (exists i

    I would like to add a flag which verify that the email was sent or at least is in the Sent Outlook folder to the following vba code.

    Code:
    Private Sub cmdEmail1_Click()
    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Dim strbody As String
    
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(olMailItem)
    
    strbody = "Dear Aaron," & vbNewLine & "Enclosed is the requested information"
    
    On Error Resume Next
    With OutMail
        .To = "drnorbert@msn.com"
        .CC = ""
        .BCC = ""
        .Subject = "Important..."
        .Body = strbody
        .SendUsingAccount = OutApp.Session.Accounts.Item(2)                         '2nd email
        .Send
    End With
    On Error GoTo 0
    
    Set OutMail = Nothing
    Set OutApp = Nothing
    End Sub
    Thanks
    Norbert
    Last edited by Rabbit; Aug 6 '15, 09:25 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
Working...