How to Extract and edit Outlook appointment attributes when the GlobalAppointmentId is known

I an creating outlook appointment from msAccess and capturing the GlobalAppointmentID when the appointment is created. I would like to update the appointment body when a make certain changes in access.

What is the code for extracting and updating the body of an appointment with a know appointmentid
LVL 16
SheilsAsked:
Who is Participating?
 
CodeCruiserCommented:
GlobalAppointmentID is a binary field so you cannot search or filter on it based on my research. One workaround I found on MSDN is to add a GUID to user properties of the appointment and then filter on this GUID.

Create appointment with GUID
Dim outlookApp As New Outlook.Application()
Dim appt As Outlook.AppointmentItem = TryCast(outlookApp.CreateItem(Outlook.OlItemType.olAppointmentItem), Outlook.AppointmentItem)
appt.Display(False)
appt.Subject = "XYZ"
appt.Start = DateTime.Now
appt.[End] = DateTime.Now.AddDays(2)
appt.Location = "Here"
appt.UserProperties.Add("GUID", Outlook.OlUserPropertyType.olText)

' The Guid to use 
Dim test As Guid = Guid.NewGuid()
appt.UserProperties("GUID").Value = test.ToString()
appt.Close(Outlook.OlInspectorClose.olSave)

Open in new window


Code to find the appointment later
Dim item As Outlook.AppointmentItem = TryCast(outlook.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar).Items.Find("[GUID]='" + test.ToString() + "'"), Outlook.AppointmentItem)

Open in new window



source
https://social.msdn.microsoft.com/Forums/en-US/fc5fce6d-906a-47f1-be28-67905806e52b/retrive-appointment-item-from-global-appointment-id?forum=vsto
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.