Getting Contact info from Distribution List

  • Thread starter Thread starter Dominic
  • Start date Start date
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
'***********************************
 
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
 
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
 
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
 
Back
Top