Determine if Appointment Item was Sent or Cancelled

XelaIrodavlas

Registered User.
Local time
Today, 08:20
Joined
Oct 26, 2012
Messages
175
Hello,

I have code that prepares a calender appointment in Outlook (based on similar code for prewritten emails). I would like to check if the user actually clicked send, or if something stopped it. For emails there is mailitem.Sent, is there an equivalent for appointments?

AppointmentItem.MeetingStatus seems close, but I can't figure out a way to make it work.

Here's what I'm working with, note outMail.MeetingStatus is returning 1 regardless of whether i click send or cancel! :(
Code:
Dim outApp As Outlook.Application
Dim outMail As Outlook.AppointmentItem

Set outApp = CreateObject("Outlook.Application")
Set outMail = outApp.CreateItem(1)

'Script and display the Appointment:
With outMail
    .MeetingStatus = olMeeting
    .AllDayEvent = False
    .Start = Date + 3
    .Duration = 1440    '(Default unit = minutes)
    .Subject = vSubject
    .Body = "Appointment has been scheduled."
    .RequiredAttendees = "XelaIrodavlas"
    .Location = "Some Place"
    .OptionalAttendees = "Ann Other"
    .Display True
End With

debug.print outMail.MeetingStatus

Any ideas would be much appreciated. :)

Edit: this is what I use to track Email items:
Code:
'Check if the email was sent or just closed
On Error Resume Next
vMsgSent = outMail.Sent '(Required to generate an error)
If Err = 0 Then
    'Message not sent
    TrackedEmail = False
Else
    'Message Was Sent
    TrackedEmail = True
End If
'Reset error handling
On Error GoTo Error_Handler
 
Last edited:
Don't recall offhand the details of Appointment transmission, but ... if you can recognize the appointment, have you looked at the Sent Items list to see if it is there?
 
it is no surprise that AppointmentItem.MeetingStatus is returning 1 regardless of what you do. read the remarks section here:


the actual appointment item page doesn't say much:


but the meeting item page does say something useful in the remarks section:


perhaps you willl find the answer there.
 

Users who are viewing this thread

Back
Top Bottom