How can I modify conversationTopic so emails with different subjects are put in the same thread?

后端 未结 4 817
走了就别回头了
走了就别回头了 2020-12-10 16:26

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 MailIte

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 17:03

    Using Outlook Redemption, I was able to merge selected Mail Items into a single conversation with the following code. I modeled it off of @fredless's answer above for my needs.

    Public Sub MergeConversations()
    
    Dim NewConversationTopic As String
    Dim msg As MailItem
    Dim msgSel As Selection
    Dim oRDOSess, oNS, objRDOitem As Object
    
    Set msgSel = Nothing
    Set msgSel = Application.ActiveExplorer.Selection
    
    If msgSel.Count <= 1 Then
       MsgBox ("Multiple Mail Items have not been selected!")
       Set msgSel = Nothing
       Exit Sub
    End If
    
    Set msg = msgSel.Item(1)
    
    NewConversationTopic = msg.ConversationTopic
    
    Set msg = Nothing
    
    Set oRDOSess = CreateObject("Redemption.RDOSession")
    Set oNS = Nothing
    Set oNS = Outlook.GetNamespace("MAPI")
    oNS.Logon
    oRDOSess.MAPIOBJECT = oNS.MAPIOBJECT
    
    For Each msg In msgSel
       Set objRDOitem = oRDOSess.GetMessageFromID(msg.EntryID, msg.Parent.StoreID)
       objRDOitem.ConversationTopic = NewConversationTopic
    

    'the following line is from this answer

       objRDOitem.Fields("http://schemas.microsoft.com/mapi/proptag/0x00710102") = Null
       objRDOitem.Save
       Set objRDOitem = Nothing
    Next msg
    
    Set msgSel = Nothing
    Set msg = Nothing
    
    End Sub
    

提交回复
热议问题