Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 通过EWS访问公共字符串MAPI属性_C#_Outlook_Exchangewebservices_Mapi - Fatal编程技术网

C# 通过EWS访问公共字符串MAPI属性

C# 通过EWS访问公共字符串MAPI属性,c#,outlook,exchangewebservices,mapi,C#,Outlook,Exchangewebservices,Mapi,我通过Outlook应用程序中的JavaScript在Outlook中的约会中创建了自定义属性,这些属性已成功保存。我已检查了此约会的MAPI属性,可以将该属性视为JSON字典 存储属性的MFCMAPI显示: 我现在正试图通过一个C#应用程序中的EWS检索这个。为了进行故障排除,我还尝试检索另一个ID为33336的属性 ExtendedPropertyDefinition epd = new ExtendedPropertyDefinition(DefaultExtendedPropertyS

我通过Outlook应用程序中的JavaScript在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);
ExtendedPropertyDefinition epd=新的ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicString,“cecp propertyNames”,MapPropertyType.String);
ExtendedPropertyDefinition epd2=新的ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment,33336,MapPropertyType.String);
//创建我们的同步窗口。这是它将捕获和同步的约会时间段
CalendarView cv=新日历视图(开始日期同步、结束日期同步);
cv.PropertySet=新的PropertySet(BasePropertySet.FirstClassProperties,epd,epd2);
FolderId calendarFolderId=新的FolderId(WellKnownFolderName.Calendar,room.Address);
FindItemsResults fappts=service.findApoints(calendarFolderId,cv);

Exchange返回适当的约会项目,但在访问扩展属性时,仅返回ID为33336的属性(测试属性)。每当我尝试检索PS_PUBLIC_STRINGS项目时,都不会有任何结果。

您的imgur链接被令人沮丧地截断。我无法查看命名属性guid列以检查它是否与您在EWS代码中尝试的内容匹配。所以我只能猜测我认为你的属性集是错误的


您是否尝试过使用EWS编辑器查看该项,以查看它是否找到您要查找的属性?如果有,您可以读取构建EWS代码所需的详细信息。

如果您使用OutlookSpy(单击IMessage)查看Outlook中的项目,是否看到该特定项目上设置的属性?是的,我可以在约会项目的IMessage中看到它及其值。这可能与,尽管它朝着另一个方向发展:Outlook无法看到使用Exchange创建的扩展属性。也许您应该尝试使用PropertyAccessor?它不应该是
ExtendedPropertyDefinition epd=new ExtendedPropertyDefinition(新Guid(“00020329-0000-0000-C000-0000000000 46”),“cecp-575fdc31-b868-4ea2-97db-bed72794e805”,MapPropertyType.String)?那么OutlookSpy显示的GUID和id是什么?它们与代码中的内容匹配吗?