Results 1 to 2 of 2
  1. #1
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662

    Detect whether Mail has been sent or Cancelled


    Pseudo code for sending Email.
    Need help with Detecting whether Mail opened for Display & Editing, has been sent or the Mail has been cancelled ( Part marked in red ).

    Code:
    Private Sub btnSendEmail_Click()
        Dim appOutLook As Outlook.Application
        Dim MailOutLook As Outlook.MailItem
    
    
        Set appOutLook = CreateObject("Outlook.Application")
        Set MailOutLook = appOutLook.CreateItem(olMailItem)
    
    
        With MailOutLook
            .BodyFormat = olFormatRichText
            .To = "email address"
            .CC = " "
            .Subject = "test"
            .HTMLBody = "test"
    
            .Display ' If you want to see before sending
    
            'Here Capture whether Mail has been sent or the Send has been cancelled - How to do this ?
            'pseudo code
            If MailOutlook.Sent Then
                (Do something ) 
            Else 
                (Do something Else ) 
            End if
    
        End With
        
        Exit Sub
        email_error:
            MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
        Resume Error_out
        Error_out:
    End Sub
    Thanks

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Sorry, Should have proceeded further after writing the pseudocode.
    There actually is .Sent

    Thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-14-2012, 10:27 AM
  2. Error When Event is Cancelled
    By tylerg11 in forum Forms
    Replies: 1
    Last Post: 02-07-2012, 09:48 AM
  3. OpenReport cancelled
    By wharting in forum Reports
    Replies: 15
    Last Post: 11-11-2011, 02:34 PM
  4. The OpenReport action was cancelled
    By Paul H in forum Reports
    Replies: 5
    Last Post: 11-11-2011, 02:27 PM
  5. Table NOT TO update if SendObject cancelled
    By Hello World in forum Forms
    Replies: 1
    Last Post: 10-14-2011, 09:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums