如何修改 sessionTopic 以便将不同主题的电子邮件放在同一线程中? [英] How can I modify conversationTopic so emails with different subjects are put in the same thread?
问题描述
我想帮助 Outlook 2010 处理我的电子邮件.我的理解是,它基于 MailItem
的 conversationTopic
属性建立对话视图.我编写了以下方法并创建了一个规则,以便它会触发电子邮件主题,例如订单# 345 - 供应商回复"和订单# 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 宏中,然后在接收到具有您确定的任何条件的消息时将此脚本作为规则操作运行:
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
这篇关于如何修改 sessionTopic 以便将不同主题的电子邮件放在同一线程中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!