Addresses

  • Thread starter Thread starter Oggy
  • Start date Start date
O

Oggy

Hi

Can anyone please advise me how i can insert a name and address from
the microsoft address book into a exel spreadsheet. If this cannot be
done what alternitives are there?

Thanks

Oggy
 
All loaded address books in Outlook are available through the AddressLists
collection. If you know the name of the contact, you can retrieve an
AddressEntry object for that person with the following code:

Dim myNameSpace As Outlook.NameSpace
Dim myAddressList As Outlook.AddressList
Dim myAddressEntries As Outlook.AddressEntries
Dim myAddressEntry As Outlook.AddressEntry

Set myNameSpace = Application.GetNamespace("MAPI")
Set myAddressList = myNameSpace.AddressLists("Contacts")
Set myAddressEntries = myAddressList.AddressEntries
Set myAddressEntry = myAddressList.AddressEntries("John Doe")
Debug.Print myAddressEntry.Name & " - "; myAddressEntry.address
 
Back
Top