ReceivedOnBehalfOfEntryID Property
Collapse the table of content
Expand the table of content

MailItem.ReceivedOnBehalfOfEntryID Property (Outlook)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns a String representing the EntryID of the user delegated to represent the recipient for the mail message. Read-only.

expression .ReceivedOnBehalfOfEntryID

expression A variable that represents a MailItem object.

This property corresponds to the MAPI property PidTagReceivedRepresentingEntryId.

If you are getting this property in a Microsoft Visual Basic or Microsoft Visual Basic for Applications (VBA) solution, owing to some type issues, instead of directly referencing ReceivedOnBehalfOfEntryID, you should get the property through the PropertyAccessor object returned by the MailItem.PropertyAccessor property, specifying the MAPI property PidTagReceivedRepresentingEntryId property and its MAPI proptag namespace. The following code sample in VBA shows the workaround.

Public Sub GetReceiverEntryID() 
 Dim objInbox As Outlook.Folder 
 Dim objMail As Outlook.MailItem 
 Dim oPA As Outlook.PropertyAccessor 
 Dim strEntryID As String 
 Const PidTagReceivedRepresentingEntryId As String = "" 
 Set objInbox = Application.Session.GetDefaultFolder(olFolderInbox) 
 Set objMail = objInbox.Items(1) 
 Set oPA = objMail.PropertyAccessor 
 strEntryID = oPA.BinaryToString(oPA.GetProperty(PidTagReceivedRepresentingEntryId)) 
 Debug.Print strEntryID 
 Set objInbox = Nothing 
 Set objMail = Nothing 
End Sub 

© 2016 Microsoft