Determine if Appointment Item was Sent or Cancelled (1 Viewer)

XelaIrodavlas

Registered User.
Local time
Today, 21:56
Joined
Oct 26, 2012
Messages
162
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:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:56
Joined
Feb 28, 2001
Messages
22,560
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?
 

conception_native_0123

Well-known member
Local time
Today, 15:56
Joined
Mar 13, 2021
Messages
1,500
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

Top Bottom