通过交谈使用EWS和Exchange 2007实现展望2010年的小组 [英] Implementing Outlook 2010's group by conversation using EWS and Exchange 2007

查看:179
本文介绍了通过交谈使用EWS和Exchange 2007实现展望2010年的小组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用的EWS来产生我们的一些邮箱的一些分析。

We're using EWS to generate some analytics on some of our mailboxes.

这部分是得到一个计数/名/对话开始/结束。一个对话是类似于途观2010显示他们交谈分组时。

Part of this is getting a count/name/start/end of conversations. A conversation being analogous to the way Outlook 2010 shows them when grouping by conversation.

我希望能够使用的conversationId组项目,但是这似乎是在Exchange 2010特有的功能。

I was hoping to be able to use the ConversationId to group items, but that seems to be an Exchange 2010-only feature.

我可以通过一个文件夹内的学科组得到线程的一个简单的想法......然而,这不处理拆分的谈话,像Outlook 2010不 - 具体而言,它不处理带来了在已发送的邮件的答复(这些都是对我们非常重要 - 不也看回复,我们不能得到很好的指标)。

I can group by subject within a folder to get a simple idea of threads... however this does not handle split conversations, as Outlook 2010 does - specifically, it doesn't handle bringing in the replies that are in the sent items (these are important to us - we can't get good metrics without also looking at replies).

我目前获取线程信息代码如下所示:

My current code for getting thread info looks like this:

private IEnumerable<EmailThread> GetThreads(Folder folder)
    {
        var view = new ItemView(int.MaxValue) {PropertySet = new PropertySet(BasePropertySet.IdOnly)};

        // view.PropertySet.Add(ItemSchema.ConversationId); - Can't use this as we're stuck on Exchange 2007 !!!
        view.PropertySet.Add(ItemSchema.Subject);
        view.PropertySet.Add(ItemSchema.DateTimeReceived);

        var grouping = new Grouping(ItemSchema.Subject, SortDirection.Descending, ItemSchema.DateTimeReceived, AggregateType.Maximum);
        var groupResults = folder.FindItems(view, grouping);


        return groupResults.Select(x => new EmailThread
        {
            Name = x.Items.First().Subject,
            Items =  x.Items.Count,
            StartDate = x.Items.Last().DateTimeReceived, // Assume last in thread is first email
            EndDate = x.Items.First().DateTimeReceived // Assume first in thread is most recent
        });
    }



我希望有人知道有效地得到回复信息?构成对话的一部分。

I am hoping someone knows of a neat way to efficiently get information on replies that constitute part of a conversation?

推荐答案

您可以通过扩展属性获取的conversationId和ConversationIndex:

You can fetch the ConversationId and the ConversationIndex via extended properties:

private static readonly ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
private static readonly ExtendedPropertyDefinition ConversationIndexProperty = new ExtendedPropertyDefinition(0x0071, MapiPropertyType.Binary);

var items = service.FindItems(WellKnownFolderName.Inbox, new ItemView(512) { PropertySet = new PropertySet(BasePropertySet.FirstClassProperties, 
            ConversationIdProperty, ConversationIndexProperty)});



两者都是二进制的属性。其内容在这里很详细的描述:

Both are binary properties. Their content is described in great detail here:

[MS-OXOMSG]:E-Mail对象协议规范,部分2.2.1.2 2.2.1.3和

[MS-OXOMSG]: E-Mail Object Protocol Specification, section 2.2.1.2 and 2.2.1.3.

本身在定义的属性[ MS-OXPROPS]:Exchange服务器协议主属性列表

这篇关于通过交谈使用EWS和Exchange 2007实现展望2010年的小组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆