Public Contacts Folder 
Author Message
 Public Contacts Folder

I am new to programming with Exchange/Outlook and am
trying to do something that is pretty easy (from what I
have read).

I am trying to access a public contacts folder to retrieve
the contact's name and SMTP email address.  I am able to
access the folder and retrieve the name, but the email
address has been impossible for me.  I have tried using a
couple  different techniques (Outlook Class and CDO).

I am using the Messages collection to retrieve this
information using the following constants:

Const CdoPR_EMAIL = &H39FE001E
Const CdoPR_GIVEN_NAME = &H3A06001E
Const CdoPR_SURNAME = &H3A11001E

For Each objMessage In objMessages
Debug.Print objMessage.Type
strFirstName = objMessage.Fields(CdoPR_GIVEN_NAME)
strLastName = objMessage.Fields(CdoPR_SURNAME)
strEmail = objMessage.Fields(CdoPR_EMAIL)

Debug.Print strFirstName & vbCrLf
Debug.Print strEmail & vbCrLf
Next

The email address is blank.  Am I using the write
collection (Message)?  I have also used the
Outlook.ContactItem and can get to the email address
(Email1Address) but the format is type "EX".  Any help
would be greatly appreciated.



Sat, 29 May 2004 00:14:22 GMT  
 Public Contacts Folder
E-mail is stored in a named property. See http://www.cdolive.com/cdo10.htm for
the list of the contact properties and how to access named properties in CDO.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:
> I am new to programming with Exchange/Outlook and am
> trying to do something that is pretty easy (from what I
> have read).

> I am trying to access a public contacts folder to retrieve
> the contact's name and SMTP email address.  I am able to
> access the folder and retrieve the name, but the email
> address has been impossible for me.  I have tried using a
> couple  different techniques (Outlook Class and CDO).

> I am using the Messages collection to retrieve this
> information using the following constants:

> Const CdoPR_EMAIL = &H39FE001E
> Const CdoPR_GIVEN_NAME = &H3A06001E
> Const CdoPR_SURNAME = &H3A11001E

> For Each objMessage In objMessages
> Debug.Print objMessage.Type
> strFirstName = objMessage.Fields(CdoPR_GIVEN_NAME)
> strLastName = objMessage.Fields(CdoPR_SURNAME)
> strEmail = objMessage.Fields(CdoPR_EMAIL)

> Debug.Print strFirstName & vbCrLf
> Debug.Print strEmail & vbCrLf
> Next

> The email address is blank.  Am I using the write
> collection (Message)?  I have also used the
> Outlook.ContactItem and can get to the email address
> (Email1Address) but the format is type "EX".  Any help
> would be greatly appreciated.



Sat, 29 May 2004 01:22:59 GMT  
 Public Contacts Folder

Dmitry,

I have used that site and page to develop what I have gotten so far.  I am using the Email property tag as such:

Const CdoPR_EMAIL = &H39FE001E
strEmail = objMessage.Fields(CdoPR_EMAIL)

but it is returning no value.  If I use the Outlook.ContactItem, I get the 'EX' email type when I really need the SMTP type.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 29 May 2004 06:55:45 GMT  
 Public Contacts Folder
Look at that contact using MdbView or OutlookSpy to see which properties are
actually available. To convert the EX address to SMTP, you will need to actually
open the address entry corresponding to the EX address and look either at the
PR_EMS_AB_PROXY_ADDRESSES or 0x39FE001E properties.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:

> Dmitry,

> I have used that site and page to develop what I have gotten so far.  I am

using the Email property tag as such:
Quote:

> Const CdoPR_EMAIL = &H39FE001E
> strEmail = objMessage.Fields(CdoPR_EMAIL)

> but it is returning no value.  If I use the Outlook.ContactItem, I get the

'EX' email type when I really need the SMTP type.
Quote:

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Sat, 29 May 2004 07:00:43 GMT  
 Public Contacts Folder

I looked at the value of PR_EMS_AB_PROXY_ADDRESSES - it is false for every contact.  How would I go about converting?

 Or

I also downloaded OutlookSpy and looked at a particular contact.  I don't see any value for their smtp email address but I do see the display name (I do see the EX value too).  I can use the display name to filter all the people in the Global Address list to find the SMTP email address.  The property tag for this item is 0x81D0.  How would I get the value programmatically?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 29 May 2004 22:35:36 GMT  
 Public Contacts Folder
PR_EMS_AB_PROXY_ADDRESSES is a property defined for the Exchange Address entries
(IMailUser). The contacts are regular messages (IMessage).
All the 0x8000 and higher properties are named properties - you should access
them using different syntax - see http://www.cdolive.com/cdo10.htm .  Property
tags for the named properties are different on different machines, but their ids
and GUIDs are the same.
To get the SMTP address from a contact:
1. Read EMail1EntryID property from the contact using Outlook Object Model or
(in case of CDO) read  0x8085, {00062004-0000-0000-C000-000000000046} named
prop.
2. Use it to call CDO's Session.GetAddressEntry()
3. Call AddressEntry.Fields(PR_EMS_AB_PROXY_ADDRESSES)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


I looked at the value of PR_EMS_AB_PROXY_ADDRESSES - it is false for every
contact.  How would I go about converting?

 Or

I also downloaded OutlookSpy and looked at a particular contact.  I don't see
any value for their smtp email address but I do see the display name (I do see
the EX value too).  I can use the display name to filter all the people in the
Global Address list to find the SMTP email address.  The property tag for this
item is 0x81D0.  How would I get the value programmatically?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 30 May 2004 01:09:32 GMT  
 Public Contacts Folder

Thank you very much!  I have been trying to figure this out for a couple of weeks now.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 31 May 2004 02:57:16 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Referring to Items in Public (Contacts) Folder

2. Error copying a public Contact folder within Outlook 2000 SR1

3. Email address from a public contact folder - PLEASE HELP

4. Tracking all activities from a public contact folder

5. Using Crystal Reports 8.5 to Report Fields From Public Contacts Folder on Exchange 5.5 Server

6. How to add a Contact in a Public Contact Folder ?

7. Public Folder Contact folders.

8. Syncronize in programmatic way, the folder Contact with the public folder

9. Custom public Contact folder.. how to ?????

10. HELP! Automating adding a public contacts folder in Exchange to OAB

11. Programatically check 'email address book' for public contact folder

12. How do I add a contact to a public folder programatically

 

 
Powered by phpBB® Forum Software