I am currently working on EWS to have some integration of our enterprise application with Exchange 2010. I use EWS to create an appoinment for Exchange 2010, and it works great; but lately I tried to add some custom / extended property when creating a meeting, below my code adds an extended property.
Dim customField As New ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "MyCustomField", MapiPropertyType.String)
appointment.SetExtendedProperty(customField, "CustomFieldValue")
The above codes can create a custom field for assignment.
Now here is my problem. When I open an appointment in Outlook that I created and go to "Developer> Design this form" and then the "All Fields" tab, I see only the custom field that I created in the "Custom field in the folder" but not in "Custom field in this item. "
I also create an Outlook add-in to respond to a custom field that I created using EWS when a user opens a meeting in Outlook, when I tried to find a custom field, I could not find a custom field because the custom field is created in the "Custom field in folder "but not in" User Defined Field on this item ".
These are codes in the Outlook add-in and will be executed when the user opens the meeting in Outlook. But since the user field is not in "in this element",. Find () returns Nothing.
Dim appt As Outlook.AppointmentItem
appt = TryCast(inspector.CurrentItem, Outlook.AppointmentItem)
If appt.UserProperties.Find("MyCustomField") Is Nothing Then
'Some action
Else
'Some action
End If
What I want to achieve is to create an appointment with a custom field (advanced property) using EWS, and then read the custom field (advanced property) in the Outlook add-in when the user opens the appointment in Outlook.
EDIT:
The value that I assigned to the custom field using EWS is shown in "Custom field in folder." How to get value from my Outlook add-in? Maybe I can get the value and add a custom field to the element and with the value?
Thank.