【问题标题】:Access Public String MAPI Properties through EWS通过 EWS 访问公共字符串 MAPI 属性
【发布时间】: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


【解决方案1】:

您的 imgur 链接被剪裁得令人沮丧。我看不到命名属性 guid 列来检查它是否与您在 EWS 代码中尝试的内容相匹配。所以我只能猜测我认为你设置了错误的属性。

您是否尝试过使用 EWS 编辑器查看项目,看看它是否自然地找到了您正在寻找的属性?如果是这样,您可以阅读构建 EWS 代码所需的详细信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-28
    • 1970-01-01
    • 1970-01-01
    • 2016-07-30
    • 2012-08-13
    相关资源
    最近更新 更多