Sgdva
Sgdva

Reputation: 2800

How to determine if Appointment Object was sent?

I would like to get a "Sent" property for an AppointmentItem to determine if the invitation was sent or not - either cancelled by user after clicking the displayed window or server issues.

While I read that the appointment has a Saved Property, this doesn't tell me if it was sent like the one in MailItem.

I don't think the code would be helpful, but, here it is:

Dim olApp As Outlook.Application
Dim olAgenda As Outlook.AppointmentItem
Set olApp = New Outlook.Application
Set olAgenda = olApp.CreateItem(1)

With olAgenda
    .Subject = "Test"
    .Recipients.Add = "[email protected]"
    .Display
    On Error Resume Next

    'here is where I would need to catch the kind of "was it sent?" variable.
    Call .ItemProperties.Item("Saved")
    
    If Err.Number = 0 Then             '99. If Error
        MsgBox "Item Send"
    Else                               '99. If Error
        MsgBox "Item Not Send"
    End If                             '99. If Error
    
End With

Please note, I don't like late binding, reference for Outlook library has to be added.

How could I catch if the AppointmentItem was sent?

Upvotes: 2

Views: 530

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66215

Appointment itself is never sent - its stays in the Calendar folder. Only MeetingItem objects are sent.

That being said, use the AppointmentItem.MeetingStatus property.

Upvotes: 2

Related Questions