如何修改对话主题,以便将具有不同主题的电子邮件放在同一线程中? [英] How can I modify conversationTopic so emails with different subjects are put in the same thread?
问题描述
我想帮助Outlook 2010对我的电子邮件进行处理.我的理解是,它基于MailItem
的conversationTopic
属性建立了会话视图.我编写了以下方法并创建了一条规则,以便它将在电子邮件主题(如"Order#345-供应商的回复"和"Order#345-来自客户的回复")上触发并将它们放在同一线程中.不幸的是,conversationTopic
是只读属性.
I want to help Outlook 2010 thread my emails. My understanding is that it bases the conversation view off of the conversationTopic
property of the MailItem
. I wrote the following method and created a rule so it would trigger on email subjects like "Order# 345 - Reply from vendor" and "Order # 345 - Reply from customer" and put them in the same thread. Unfortunately the conversationTopic
is a read only property.
有人知道解决这个问题的方法,或者是更好的完成同一任务的方法吗?谢谢!
Does anyone know a way around this or perhaps a better way of accomplishing the same task? Thanks!
Sub ModifyConversationTopic(Item As Outlook.MailItem)
Dim regex As RegExp
Dim newMailItem As Outlook.MailItem
newMailItem = Item.Copy
Set regex = New RegExp
regex.IgnoreCase = False
regex.Global = True
regex.Pattern = "(Order# [0-9]+) .*"
If regex.Test(newMailItem.Subject) Then
Dim matches As MatchCollection
Set matches = regex.Execute(newMailItem.Subject)
Set topic = matches.Item(0)
MsgBox ("OH YEAH" + topic)
newMailItem.ConversationTopic = topic
newMailItem.Save
End If
End Sub
推荐答案
正在寻找几乎完全相同的东西,正如您指出的那样,这对于正常暴露的对象似乎是不可能的,但是VBA宏+ Outlook Redemption允许轻松调整对话主题.另外,原始消息主题不变,但消息仍显示在一个简洁的对话组中.
Was looking for pretty much the exact same thing, this doesn't seem to be possible with normally exposed objects as you point out, but VBA macro + Outlook Redemption allows conversation topic to be tweaked easily. Bonus, the original message subject is unchanged, but the messages still show in a nice neat conversation group.
这样的事情被扔到VBA宏中,然后在收到具有您确定的任何条件的消息时作为Rule操作运行此脚本.
Something like this, thrown into VBA Macro and then run this script as a Rule action when messages are received with whatever criteria you determine:
Sub MsgProcess(msg As MailItem)
Dim oNS As Object
Dim oRDOSess As Object
Dim oRDOItem As Object
Dim sEntryID As String
Dim sStoreID As String
Dim NewConversationTopic As String
Set oRDOSess = CreateObject("Redemption.RDOSession")
Set oNS = Nothing
Set oNS = Outlook.GetNamespace("MAPI")
oNS.Logon
oRDOSess.MAPIOBJECT = oNS.MAPIOBJECT
sEntryID = msg.EntryID
sStoreID = msg.Parent.StoreID
Set oRDOItem = oRDOSess.GetMessageFromID(sEntryID, sStoreID)
'Apply what modifications to topic you want here - dumb example string manipulation shown
NewConversationTopic = Replace(oRDOItem.ConversationTopic, "BLACK", "WHITE")
oRDOItem.ConversationTopic = NewConversationTopic
oRDOItem.Save
End Sub
这篇关于如何修改对话主题,以便将具有不同主题的电子邮件放在同一线程中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!