trying to get recipient email address

Discussion in 'Microsoft Outlook VBA Programming' started by TMJNSK, Oct 15, 2007.

  1. TMJNSK

    TMJNSK Guest

    Hi All,

    I have tried access sender's email and receiver's email. I have found
    a code to get sender's email.I have used Redemption.safermailitem,
    which works cool. But i have trouble in getting the receiver email
    address.

    I have tried the following items (sample code got it from internet)
    Dim utils, MailItem, PrSMTPAddress, SMTPAddress
    utils = CreateObject("Redemption.MAPIUtils")
    PrSMTPAddress = &H39FE001E
    'Get SMT P address of the first recipient. It is
    assumed that the recipient is an Exchange Server user.
    SMTPAddress =
    utils.HrGetOneProp(oMailItem.Recipients(1).AddressEntry.MAPIOBJECT,
    PrSMTPAddress)
    LogMessage("Receiver Address" + SMTPAddress)

    But i am getting the following error at the place of HrGetOneProp -
    System.Runtime.InteropServices.COMException (0xA5120009): Property is
    read-only.
    at Outlook.AddressEntry.set_MAPIOBJECT(Object MAPIOBJECT)
    at
    DIAMSXe_OutlookAddIn.XMailItem.btnAttachToDIAMSXe_Click(CommandBarButton
    ctrl, Boolean& cancel) at Outlook.AddressEntry.set_MAPIOBJECT(Object
    MAPIOBJECT)
    at
    DIAMSXe_OutlookAddIn.XMailItem.btnAttachToDIAMSXe_Click(CommandBarButton
    ctrl, Boolean& cancel)Property is read-only.

    For more information, see Help and Support Center at
    http://go.microsoft.com/fwlink/events.asp.



    Issue number 2:
    Dim utils1, MailItem1, PrSenderEmailAddress,
    SenderEMail
    utils1 = CreateObject("Redemption.MAPIUtils")
    PrSenderEmailAddress = &HC1F001E
    SenderEMail =
    utils1.HrGetOneProp(oMailItem.MAPIOBJECT, PrSenderEmailAddress)
    LogMessage("Sender Address" + SenderEMail)

    When i used this for sender's email, i was getting
    "/O=COMPANYDOMAIN/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/
    CN=RECEIVERNAME.. "
    Is this going to be the same for receiver email too?

    Actually, i am looking for Email id. Can some one help me here.
     
    TMJNSK, Oct 15, 2007
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cherry

    Get Recipient address, Mail Content and Attachment

    Cherry, Dec 30, 2003, in forum: Microsoft Outlook VBA Programming
    Replies:
    1
    Views:
    360
    Eric Legault [MVP - Outlook]
    Jan 5, 2004
  2. Darren W.

    how to get the recipient email addresses

    Darren W., Aug 31, 2004, in forum: Microsoft Outlook VBA Programming
    Replies:
    3
    Views:
    253
    Sue Mosher [MVP-Outlook]
    Sep 1, 2004
  3. Darren W.

    how to get the recipient email addresses

    Darren W., Aug 31, 2004, in forum: Microsoft Outlook VBA Programming
    Replies:
    0
    Views:
    160
    Darren W.
    Aug 31, 2004
  4. Bingo

    How to get the recipient's email address in Redemption?

    Bingo, Nov 29, 2004, in forum: Microsoft Outlook VBA Programming
    Replies:
    7
    Views:
    4,423
    kundan_iitg
    Mar 30, 2010
  5. Art

    Retriving a Failed Recipient' email address

    Art, Dec 16, 2008, in forum: Microsoft Outlook VBA Programming
    Replies:
    1
    Views:
    448
    Ken Slovak - [MVP - Outlook]
    Dec 16, 2008
Loading...

Share This Page