Consulting

Results 1 to 5 of 5

Thread: Entry ID of the mail being replied to

  1. #1

    Question Entry ID of the mail being replied to

    Hi All

    I need help with the code to identify the Entry ID of the mail being replied. Appreciate any help.

    Thanks

  2. #2
    To explain, I am looking to identify the parent mail of the reply/forwarded mail while it is being drafted.

  3. #3
    VBAX Tutor TheAntiGates's Avatar
    Joined
    Feb 2005
    Location
    Tejas
    Posts
    263
    Location
    This is discussed in http://dailydoseofexcel.com/archives/category/Outlook/ It looks wonky, but he (who is no fool) attributes the method to Sue Mosher (who is a high guru on Outlook). Read the whole [short] article which explains the process.
    I just found a cool semi-advanced VBA page - dictionary, queue, etc. http://analystcave.com/excel-vba-dic...ta-structures/

  4. #4
    Thanks for your reply. I have adapted the code but am unable to retrieve the Entry ID using the propertyaccessor. It is returning blank. Can you help point out where I am getting it wrong.

    Function FindParentMessageID(objMsg As Outlook.MailItem) As String
        Dim sFind As String
        Dim sIndex As String
        Dim olFldr As Outlook.MAPIFolder
        Dim olItems As Outlook.Items
        Dim olMi As Object
        Dim objPA As Outlook.PropertyAccessor
        
        sIndex = Left$(objMsg.ConversationIndex, Len(objMsg.ConversationIndex) - 10)
        
        If Application.ActiveInspector Is Nothing Then
            Set olFldr = Application.ActiveExplorer.Selection.Item(1).Parent
        Else
            Set olFldr = Application.ActiveInspector.CurrentItem.Parent
        End If
        
        sFind = "[ConversationTopic] = " & Chr$(34) & objMsg.ConversationTopic & Chr$(34)
        
        Set olItems = olFldr.Items.Restrict(sFind)
        For Each olMi In olItems
            If olMi.Class = olMail Then
                If Left(olMi.ConversationIndex, Len(sIndex)) = sIndex Then
                    Set objPA = olMi.PropertyAccessor
                    FindParentMessageID = objPA.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x1035" & PT_STRING8)
                    Set objPA = Nothing
                    Exit For
                End If
            End If
        Next olMi
    End Function

  5. #5
    VBAX Tutor TheAntiGates's Avatar
    Joined
    Feb 2005
    Location
    Tejas
    Posts
    263
    Location
    Sorry, your code (e.g. using PropertyAccessor) is a little too elaborate for me. I know the Daily Dose code works, especially as modified in the comments there, which I use regularly.

    Anyone who understands the PropertyAccessor code in your post above, please help him!
    I just found a cool semi-advanced VBA page - dictionary, queue, etc. http://analystcave.com/excel-vba-dic...ta-structures/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •