我可以通过VBA在Outlook中修改会话ID来对独立的电子邮件进行分组吗? [英] Can I modify Conversation ID in Outlook by VBA to group independent Emails?

查看:113
本文介绍了我可以通过VBA在Outlook中修改会话ID来对独立的电子邮件进行分组吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确实收到了很多由各种机器人发送的邮件.我可以按主题轻松识别电子邮件(例如:对票单123的回复"). 不幸的是,每封电子邮件都是自动自动生成的.

I do receive a lot of mails sent by various robots. I can identify Emails easily by subject (for example: "Response to ticket 123"). Unfortunately each email is generated automatically, individually.

对于此Outlook,不像普通对话那样对它们进行分组.

For this Outlook does not Group them as an ordinary conversation does.

我想知道是否可以修改例如邮件属性"ConversationID"?我是否需要创建一个"ConversationTopic"并将其分配给相关的MailItems?

I wonder if it is possible to modify for example the mail property "ConversationID"? Do I Need to create a "ConversationTopic" and assign it to the related MailItems?

推荐答案

我能够使用

I was able to solve this myself by using Redemption to get write-access to the MAPI properties of ConversationTopic and ConversationIndex.

虽然显然首先使用ConversationTopic对消息进行分组,但是ConversationIndex在分组中也起着作用:它不仅带有排序时间戳,而且头一个字节是必须在会话的所有电子邮件中都匹配的会话代码.否则,即使具有相同的主题,它们仍不会分组.有关详细信息,请参见此处: https://msdn.microsoft .com/en-us/library/ms528174(v = exchg.10).aspx

While apparently ConversationTopic is used at first for grouping messages, also ConversationIndex plays a role in grouping: It does not only carry the sorting time stamp, but the first bytes are a conversation code that must match across all emails of a conversation. Otherwise they are still not grouped, even with same topic. See here for details: https://msdn.microsoft.com/en-us/library/ms528174(v=exchg.10).aspx

幸运的是,将Index设置为Null显然使Outlook仅关注该主题,因此我们无需重新计算新索引.

Luckily, setting the Index to Null apparently makes Outlook pay attention only to the topic, so we don't need to re-calculate a new index.

我的工作代码:

Dim oNS As Object
Dim oRDOSess As Object
Dim oRDOItem As Object

Debug.Print "Creating Redemption Object ..."
' This requires: http://www.dimastr.com/redemption/download.htm
Set oRDOSess = CreateObject("Redemption.RDOSession")
Set oNS = Nothing
Set oNS = Outlook.GetNamespace("MAPI")
oNS.Logon
oRDOSess.MAPIOBJECT = oNS.MAPIOBJECT

Set oRDOItem = oRDOSess.GetMessageFromID(incomingMail.EntryID, incomingMail.Parent.StoreID)

Debug.Print "Trying to change conversation topic ..."
oRDOItem.ConversationTopic = incomingMail.Subject

Debug.Print "Trying to change conversation index ..."
oRDOItem.Fields("http://schemas.microsoft.com/mapi/proptag/0x00710102") = Null

Debug.Print "Saving modified mail item ..."
oRDOItem.Save

这篇关于我可以通过VBA在Outlook中修改会话ID来对独立的电子邮件进行分组吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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