Use Outlook contacts in Excel 2003

O

Oggy

Hi, I created a userform in Excel 2003 and have put a Combo box on it.
I am trying to get a list of my contacts data from Outlook to insert as

a name and address in excel. Has anyone done this, is it possible.
 
M

Michael Bauer [MVP - Outlook]

Please add a ref to Outlook via Tools/References, then see the Object
Browser (F2), it shows Outlook's objects, properties etc.

From Outlook's Application object get a ref to its Namespace object:

Dim Ns as Outlook.Namespace
Set Ns=OLApp.GetNamespace("MAPI")

Then use GetDefaultFolder for the default contacts folder. It has an Items
collection, which you can walk through and read each item's properties. You
must be aware that a contact folder may contain two kind of object types:
ContactItem and DistlistItem.

Additionally, calling that from Excel you'll get a security prompt. Please
read here for your possibilities to handle that:
http://www.outlookcode.com/d/sec.htm

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Keep your Outlook categories organized!
http://www.shareit.com/product.html?productid=300120654&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am 1 Jan 2007 06:18:58 -0800 schrieb Oggy:
 

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