【发布时间】:2015-05-20 11:28:59
【问题描述】:
我在 Outlook 的 Appointment 中通过 JavaScript 在 App for Outlook 中创建了自定义属性,这些属性已成功保存。我检查了这个约会的 MAPI 属性,我可以看到该属性是一个 JSON 字典。
存储属性的MFCMAPI显示:
我现在正尝试在 C# 应用程序中通过 EWS 检索它。出于故障排除的目的,我还尝试检索 ID 为 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 返回相应的约会项目,但在访问扩展属性时,仅返回 ID 为 33336 的属性(测试项)。每当我尝试检索 PS_PUBLIC_STRINGS 项时,都没有返回任何内容。
【问题讨论】:
-
如果您使用 OutlookSpy(单击 IMessage)在 Outlook 中查看该项目,您是否看到该特定项目上设置的属性?
-
是的,我可以在约会项目的 IMessage 中看到它以及它的值。
-
这可能是相关的,尽管它在另一个方向:Outlook 看不到使用 Exchange stackoverflow.com/questions/6013173/… 创建的扩展属性。也许您应该尝试使用 PropertyAccessor?
-
不应该是
ExtendedPropertyDefinition epd = new ExtendedPropertyDefinition(new Guid("00020329-0000-0000-C000-000000000046"), "cecp-575fdc31-b868-4ea2-97db-bed72794e805", MapiPropertyType.String);吗? -
那么 OutlookSpy 会显示什么 GUID 和 id?它们与您的代码中的内容相匹配吗?
标签: c# outlook exchangewebservices mapi