none
Create mail item after sending a meeting request RRS feed

  • Question

  • Hello,

    What I am looking to do is set up an email that is setup to leave a user's inbox when a specific meeting they organized finishes. So, basically, after I send out a meeting request, an email gets created and put in the outbox with a deferral time set at sometime after the meeting ends.

    I am using the Application_ItemSend event to create this email. I cannot, however, reference anything from the AppointmentItem object. The only thing that is passed is the MeetingRequest object which does not contain neither start nor end time.

    Below you'll find a snippet of code that illustrates my issue

    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    ' // this procedure will create a polling email and save it in the outbox
    ' need to get the end time from meeting object
    
    
    Dim olApp       As Outlook.Application
    Dim olMail      As Outlook.MailItem
    Dim olMeeting   As Outlook.AppointmentItem
    Dim dtTimeSent  As Date
    Dim olRecipient As Outlook.Recipient
    
    Set olApp = Outlook.Application
    
    Set olMeeting = Item
    
    Debug.Print Item.Class
    
    If Item.Class = olMeetingRequest Then
    
        Set olMail = olApp.CreateItem(olMailItem)
        
        With olMail
        
            For Each olRecipient In Item.Recipients
            
                .Recipients.Add (olRecipient.Name)
            
            Next olRecipient
            
            .Subject = "Please vote"
            .HTMLBody = "<FONT face='Calibri'><p>Test</p>"
            .VotingOptions = "Yes; No"
            .DeferredDeliveryTime = olMeeting.ExpiryTime
            .Recipients.ResolveAll
            .Display
        
        End With
    
    End If
    
    Cleanup:
    
    Set olApp = Nothing
    Set olMail = Nothing
    
    
    End Sub

    Any help is appreciated!


    • Edited by Dave Ocampo Tuesday, February 25, 2014 7:35 PM
    Tuesday, February 25, 2014 6:58 PM

Answers

  • The MeetingItem class provides the GetAssociatedAppointment method. Did you try to use it?
    • Marked as answer by Dave Ocampo Tuesday, February 25, 2014 7:55 PM
    Tuesday, February 25, 2014 7:42 PM

All replies