标记的电子邮件为使用Exchange Web服务2007阅读 [英] Marking an email message as read using Exchange Web Services 2007

查看:250
本文介绍了标记的电子邮件为使用Exchange Web服务2007阅读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我订阅使用Exchange Web服务2007年和加工附件,新邮件进来一个电子邮件帐户。我想,以纪念这些电子邮件的服务器上读我处理完这些后,但我发现它不是简单的IsRead属性设置为true。我甚至尝试了以下内容:

I am subscribed to an email account using Exchange Web Services 2007 and processing attachments as new emails come in. I would like to mark those emails as "read" on the server after I'm done processing them, but I'm finding it's not as simple as setting the "IsRead" property to true. I've even tried the following:

Dim msg As EmailMessage
msg.Load(New PropertySet({EmailMessageSchema.IsRead}))
msg.IsRead = True

我发现了,我不得不加载特定的架构属性,如果我想与消息(如附件)的某些部分进行交互后尝试这样做。我也试着直接绑定的消息,一个新的对象,并加载额外的属性:

I tried this after finding out that I had to load specific schema properties if I wanted to interact with certain parts of the message (like attachments). I've also tried directly binding the message to a new object and loading additional properties:

Dim iID as ItemId = msg.Id
Dim tmpMsg as EmailMessage = EmailMessage.Bind(service, iID, New PropertySet(BasePropertySet.FirstClassProperties, EmailMessageSchema.IsRead))
tmpMsg.IsRead = True

我越来越没有运气。我GOOGLE了四周,发现<一href="http://blogs.msdn.com/b/vikas/archive/2007/11/30/howto-ews-update-isread-flag-for-items-using-exchange-web-services.aspx?PageIndex=2">one 的MSDN博客的例子好像它应该工作,但他有一些类,我似乎无法找到(如 Microsoft.Exchange.WebServices.SetItemFieldType 类,我的一切在 Web服务命名空间是数据自动发现命名空间,没有阶级或任何东西)。而且因为我找不到那些类或任何类似我有点卡住。他还列举了DAV的例子,但是,同样,他的code使用类我无法找到我的版本的EWS DLL(这是14.0.0.0)。我尝试下载微软最新的API,但是这似乎是相同的版本,我已经有了。

I'm getting no luck. I've googled around and found one MSDN blog example that seems like it should work, but he's got some classes that I can't seem to find (like the Microsoft.Exchange.WebServices.SetItemFieldType class; all I've got in the WebServices namespace are the Data and AutoDiscover namespaces, no classes or anything). And since I can't find those classes or anything similar I'm kinda stuck. He also listed a DAV example but, again, his code uses classes I can't find in my version of the EWS dll (which is 14.0.0.0). I tried downloading the latest API from Microsoft but that seemed to be the same version as what I already have.

所以我的问题是,是否有标记的项目为使用Exchange 2007 Web服务阅读的一种方式?

So my question is, is there a way of marking an item as read using Exchange 2007 Web Services?

推荐答案

您需要调用tmpMsg.Update方法,坚持更改回服务器。

You need to call the tmpMsg.Update method to persist changes back to the server.

这篇关于标记的电子邮件为使用Exchange Web服务2007阅读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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