Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Addresses (http://www.outlookbanter.com/outlook-vba/45452-addresses.html)

Oggy April 7th 07 02:34 PM

Addresses
 
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


Eric Legault [MVP - Outlook] April 9th 07 08:20 PM

Addresses
 
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

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Oggy" wrote:

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 times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com