Getting Contact info from Distribution List

D

Dominic

Hello,

My goal was to programatically access
a recipiant's details (First Name, Last Name, Department,
Phone Number, Email, etc...) from a Distribution list
(Global Address List).

I got as far as accessing a specific contact using the
AddressEntry object, but i cant retrieve any details
other than the name. Please help.

Thank you,
Dominic

Here is my code:

'***********************************
'Start instance of Outlook
Dim myApp As New Outlook.Application

'Reference the Outlook namespace and use MAPI
Dim myNS As Outlook.NameSpace
Set myNS = myApp.GetNamespace("MAPI")

'Open the AddressList you want to use
Dim myAddressList As Outlook.AddressList
Set myAddressList = myNS.AddressLists("Global Address
List")

'Create Address entry list
Dim myAddressEntries As Outlook.AddressEntries
Set myAddressEntries = myAddressList.AddressEntries

'Create Address entry object
Dim myAddressEntry As Outlook.AddressEntry

'Retrieve first contact in Global Address List
Set myAddressEntry = myAddressEntries.GetFirst
'***********************************
 
D

Dmitry Streblechenko \(MVP\)

Outlook Object Model only provides access to a limited # of the address
entry properties. You will need Extended MAPI/CDO 1.21/Redemption to access
other properties.

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

Guest

Thank you for the reply Dmitry,

Would there be way to export all the address entry
properties to an excel sheet or database ?

Or can I somehow export all the contacts into my PAB
(Personal Address Book) and them access their details
from there ? (with the ContactItem object maybe ?)


Thanks again,
Dominic
 
D

Dmitry Streblechenko \(MVP\)

You'd need to write code to do that. It will be a subject to the same
limitations.

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

Dominic

Thanks again,

Can you direct me to where I can get Extended MAPI/CDO
1.21/Redemption ?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top