1

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.

grg
  • 5,023
  • 3
  • 34
  • 50
plusheen
  • 1,128
  • 1
  • 8
  • 23
  • 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 May 20 '15 at 14:18
  • Yep, I can see it in the IMessage in the appointment item along with its value. – plusheen May 20 '15 at 15:16
  • This may be related, although it goes *in the other direction*: Outlook cannot see extended properties that were created with Exchange http://stackoverflow.com/questions/6013173/creating-extended-property-using-ews-and-access-it-from-outlook-add-in. Maybe you should try to use the PropertyAccessor? – Jan Doggen May 21 '15 at 15:08
  • should not it be `ExtendedPropertyDefinition epd = new ExtendedPropertyDefinition(new Guid("00020329-0000-0000-C000-000000000046"), "cecp-575fdc31-b868-4ea2-97db-bed72794e805", MapiPropertyType.String); `? – Frostless Oct 31 '18 at 10:27
  • So what GUID and id does OutlookSpy show? Do they match what you have in your code? – Dmitry Streblechenko Oct 31 '18 at 16:02
  • From the looks of it, you have a binary property (PT_BINARY), not a string. – Dmitry Streblechenko Nov 15 '18 at 14:17

1 Answers1

0

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.

sgriffin
  • 337
  • 1
  • 9