PDA

View Full Version : Entry ID of the mail being replied to



Jeevie
07-30-2013, 04:12 AM
Hi All

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

Thanks

Jeevie
07-31-2013, 09:16 AM
To explain, I am looking to identify the parent mail of the reply/forwarded mail while it is being drafted.

TheAntiGates
08-13-2013, 04:55 PM
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.

Jeevie
08-14-2013, 10:00 PM
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

TheAntiGates
08-15-2013, 05:02 PM
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!