Issue with Outlook custom properties in shared calendar appointments

zi ad 0 Reputation points
2024-12-24T15:07:48.39+00:00

I am using VBA to add an appointment to a shared calendar that includes a custom property, here's an example of the code:

Dim objOutlook As Object
Dim objNamespace As Object
Dim objCalendar As Object
Dim objAppointment As Object
Dim vPropPath  As String

Set objOutlook = GetOutlookApp()
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objCalendar = GetOutlookCalendar()

Set objAppointment = objCalendar.items.Add(1)

objAppointment.Subject = vTitle
objAppointment.Body = vBody

vPropPath = "http://schemas.microsoft.com/mapi/id/{00020329-0000-0000-C000-000000000046}/7771001F"
objAppointment.PropertyAccessor.SetProperty vPropPath, "1"

objAppointment.Save
objAppointment.Close 0 

Set objAppointment = Nothing
Set objCalendar = Nothing
Set objNamespace = Nothing
Set objOutlook = Nothing

When I check the custom property of the created appointment, it is present initially. However, after Outlook syncs with the Exchange server or when the appointment is edited, the custom property is removed. Thanks in advance.

Outlook
Outlook
A family of Microsoft email and calendar products.
4,218 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,103 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.