1
votes

I've created custom properties in an Appointment in Outlook through JavaScript in an App for Outlook, which have saved successfully. I have checked the MAPI properties of this appointment and I can see the property as a JSON dictionary.

MFCMAPI display of the stored property:

I'm now trying to retrieve this through EWS in a C# application. For troubleshooting purposes, I also attempt to retrieve another property, with the ID of 33336.

ExtendedPropertyDefinition epd = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "cecp-propertyNames", MapiPropertyType.String);      
ExtendedPropertyDefinition epd2 = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 33336, MapiPropertyType.String);
//Create our sync window. This is the period of appointments it will capture and sync
CalendarView cv = new CalendarView(START_DATE_SYNC, END_DATE_SYNC);
cv.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties, epd, epd2);
FolderId calendarFolderId = new FolderId(WellKnownFolderName.Calendar, room.Address);
FindItemsResults<Appointment> fappts = service.FindAppointments(calendarFolderId, cv);

Exchange returns the appropriate appointment items, but when accessing the extended properties, only the property with the ID of 33336 (the test one) is returned. Any time I try and retrieve a PS_PUBLIC_STRINGS item, nothing comes back.

1
If you look at the item in in Outlook using OutlookSpy (click IMessage), do you see that property set on that particular item? - Dmitry Streblechenko
Yep, I can see it in the IMessage in the appointment item along with its value. - plusheen
This may be related, although it goes in the other direction: Outlook cannot see extended properties that were created with Exchange stackoverflow.com/questions/6013173/…. Maybe you should try to use the PropertyAccessor? - Jan Doggen
should not it be ExtendedPropertyDefinition epd = new ExtendedPropertyDefinition(new Guid("00020329-0000-0000-C000-000000000046"), "cecp-575fdc31-b868-4ea2-97db-bed72794e805", MapiPropertyType.String); ? - Frostless
So what GUID and id does OutlookSpy show? Do they match what you have in your code? - Dmitry Streblechenko

1 Answers

0
votes

Your imgur link is frustratingly cropped. I cannot see the named property guid column to check if it matches what you're trying there in the EWS code. So I can only guess that I think you've got the wrong property set.

Have you tried looking at the item with EWS Editor to see if it finds the property you're looking for naturally? If it does, you can read off the details you need to construct your EWS code.