none
Sender Name - Mapi Message Envelope Property for PR_ORIGINAL_SENDER_NAME not retrieving information RRS feed

  • Question

  • I have the following code to creat an Outlook table listing the email messages from a specific sender.  It works as it should when I use the PR_SENT_REPRESENTING_NAME property and creates a rows for a table.  If I try the same thing using the PR_ORIGINAL_SENDER_NAME property (commented out in the example) nothing is returned for the same filter.  Any ideas why this does not work for PR_ORIGINAL_SENDER_NAME but does for PR_SENT_REPRESENTING_NAME?

                'Find a message in a folder by the sender name
                'Const PR_ORIGINAL_SENDER_NAME As String = "http://schemas.microsoft.com/mapi/proptag/0x005a000f"
                Const PR_SENT_REPRESENTING_NAME As String = "http://schemas.microsoft.com/mapi/proptag/0x0042001F"
                ' Obtain Inbox
                Dim folder As Outlook.Folder = CType(olApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox), Outlook.Folder)
                'Dim filter As String = "@SQL=" & Chr(34) & PR_ORIGINAL_SENDER_NAME & Chr(34) & " like '%Johnny%'"
                Dim filter As String = "@SQL=" & Chr(34) & PR_SENT_REPRESENTING_NAME & Chr(34) & " like '%Johnny%'"
                Dim table As Outlook.Table = folder.GetTable(filter, Outlook.OlTableContents.olUserItems)

     Using VS2010, VB.net, Office 2010.

    Thank you for any assistance provided.


    • Edited by chltn07 Tuesday, January 10, 2012 8:45 PM
    Tuesday, January 10, 2012 8:14 PM

Answers

  • I have answered my own question...

    I needed to use the Message Recipient Property PR_SENDER_USER

    Const PR_SENDER_NAME As String = http://schemas.microsoft.com/mapi/proptag/0x0C1A001F
    

    PR_ORIGINAL_SENDER_NAME  was not returning a value.  Works great now. - Just in case anyone else encounters this.



    • Marked as answer by chltn07 Tuesday, January 10, 2012 9:40 PM
    • Unmarked as answer by chltn07 Tuesday, January 10, 2012 9:41 PM
    • Marked as answer by chltn07 Tuesday, January 10, 2012 9:41 PM
    • Edited by chltn07 Wednesday, January 11, 2012 2:58 PM correction
    Tuesday, January 10, 2012 9:40 PM

All replies

  • I have answered my own question...

    I needed to use the Message Recipient Property PR_SENDER_USER

    Const PR_SENDER_NAME As String = http://schemas.microsoft.com/mapi/proptag/0x0C1A001F
    

    PR_ORIGINAL_SENDER_NAME  was not returning a value.  Works great now. - Just in case anyone else encounters this.



    • Marked as answer by chltn07 Tuesday, January 10, 2012 9:40 PM
    • Unmarked as answer by chltn07 Tuesday, January 10, 2012 9:41 PM
    • Marked as answer by chltn07 Tuesday, January 10, 2012 9:41 PM
    • Edited by chltn07 Wednesday, January 11, 2012 2:58 PM correction
    Tuesday, January 10, 2012 9:40 PM
  • Glad to hear you got this work and thanks for sharing your experience and solution here.

    Have a nice day,


    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us
    Thursday, January 12, 2012 5:27 AM
    Moderator