A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

trying to get recipient email address



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 15th 07, 07:48 PM posted to microsoft.public.outlook.program_vba
TMJNSK
external usenet poster
 
Posts: 6
Default trying to get recipient email address

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).Address Entry.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.

Ads
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SMTP address of Exchange recipient Bill Outlook and VBA 5 August 8th 07 07:44 PM
How to retrieve an email address from an appointment recipient? Marcus Outlook - Using Forms 1 April 4th 07 01:56 PM
Recipient.Address in Exchange Server Joel Outlook and VBA 3 December 8th 06 04:52 AM
Color Subject by Recipient Address JoeCL Outlook - Installation 0 November 3rd 06 07:41 PM
Help! outlook keeps deleting recipient email address... networm Outlook - General Queries 2 March 8th 06 08:05 AM


All times are GMT +1. The time now is 07:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.