该EWS托管API具有的功能,用于检索和管理屈指可数的电子邮件对话(又名 电子邮件线程).不幸的是,其中很大一部分只适用于新版本的Exchange(2013等)
Outlook确实实现了针对旧版 Exchange的电子邮件线程.也许它通过自己管理线程来实现这一点(Outlook是桌面应用程序,电子邮件在本地计算机上复制,因此可以通过Conversation Topic等轻松分组).
现在,如何在Web应用程序中支持电子邮件线程?通常在Exchange客户端中支持此功能的操作是什么?通过支持我的意思是:
EWS Managed Api等问题:
我现在使用的(作为解决方法):
我正在使用EWS Managed API 1.2和Exchange Server 2007开发C#.NET Framework 4.5 Windows窗体应用程序,它执行某种类型的邮件同步.
既然我正在处理扩展属性,我想清楚一些事情:
Q1.DefaultExtendedPropertySet上课的目的是什么?MSDN 说 "定义默认的扩展属性集".
Q2.我无法决定是否应该使用自定义GUID或DefaultExtendedPropertySet.PublicStrings在构建时ExtendedPropertyDefinition:
var MyXProp = new ExtendedPropertyDefinition(
DefaultExtendedPropertySet.PublicStrings,
"MyXProp", MapiPropertyType.String);
Run Code Online (Sandbox Code Playgroud)
要么
Guid MyPropertySetId = new Guid("{C11FF724-AA03-4555-9952-FA248A11C3E}");
var extendedPropertyDefinition = new ExtendedPropertyDefinition(
MyPropertySetId, "MyXProp", MapiPropertyType.String);
Run Code Online (Sandbox Code Playgroud)
我想使用自定义扩展属性进行唯一的预约以放入数据库。我使用 FindAppointments() 查找所有约会:
var appointments = _service.FindAppointments(WellKnownFolderName.Calendar, calendarView);
Run Code Online (Sandbox Code Playgroud)
然后我使用 foreach 循环完成所有约会:
foreach (var appointment in appointments)
Run Code Online (Sandbox Code Playgroud)
对于所有没有扩展属性的约会:
if (appointment.ExtendedProperties.Count <= 0)
Run Code Online (Sandbox Code Playgroud)
我绑定了一个自定义扩展属性,并使用我专门生成的唯一会议 ID (meetingId) 设置其值:uniqe int 编号:
var myPropertySetId = new Guid("{6C3A094F-C2AB-4D1B-BF3E-80D39BC79BD3}");
var extendedPropertyDefinition = new ExtendedPropertyDefinition(myPropertySetId, "RateTheMeetingId", MapiPropertyType.Integer);
var bindedAppointment = Appointment.Bind(_service, appointment.Id, new PropertySet(extendedPropertyDefinition));
bindedAppointment.SetExtendedProperty(extendedPropertyDefinition, meetingId);
bindedAppointment.Update(ConflictResolutionMode.AlwaysOverwrite);
Run Code Online (Sandbox Code Playgroud)
但它不起作用,因为我搜索会议并尝试输出扩展属性和 tis 值,但我没有得到结果,它没有绑定。我的问题是我做错了什么以及您可以提供哪些其他解决方案来为现有约会提供自定义扩展属性?顺便说一句,我正在使用 MS Exchange server 2010_SP2。