Click to See Complete Forum and Search --> : URGENT: ADRESS LIST


jpfo
June 22nd, 2001, 10:40 AM
I have a combo box where i want the user to select a name address in my global adress list.

How can i get all the names of my address list to add it in the combo?

I already look for this, but only get information of displaing folders, messages, and x validations...

tks
JP- I rate all the help

Iouri
June 22nd, 2001, 01:23 PM
What is global address list? Is it a list box or what?

Iouri Boutchkine
iouri@hotsheet.com

Robert Moy
June 22nd, 2001, 10:08 PM
Hello:

If I understand you correctly, what you can do is put global addresses into a database and use ADO to get information from Combo:

Do Until Adodc1.Recordset.EOF


Combo1.AddItem (Adodc1.Recordset.Fields(1).Value)
Adodc1.Recordset.MoveNext
Loop

Good Luck

jpfo
June 25th, 2001, 03:01 AM
No. I really want to get all names in my Outlook Global Adress List.

jpfo
June 25th, 2001, 03:05 AM
No Iouri. I really want to get all the names in my Outlook Global Adress List and put him in a combo box. I just dont know how can i do this.

Jens-Uwe
June 25th, 2001, 10:21 AM
hello,

u should user the Microsoft Outlook Object Library.

Dim myNameSpace As Outlook.NameSpace
Set myNameSpace = Application.GetNameSpace("MAPI")
Dim myGAddressList as Outlook.AddressList
Set myGAddressList = myNameSpace.AddressLists _("Global Address List")
Dim myAddressEntries As Outlook.AdressEntries
Set myAddressEntries= myAddressList.AddressEntries
For i=1 to myAddressEntries.Count
Combo1.AddItem (myAddressEntries.Item(i).Name)
Next i

Perhaps it will helo u.

Jens-Uwe

jpfo
June 26th, 2001, 05:15 AM
Tks Jens-Uwe,

Was a nice tip, however i had to create a application object. Worked like this:

Dim myOlapp As Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myGAddressList As Outlook.AddressList
Dim myGAddressEntries As Outlook.AddressEntries
Set myOlapp = CreateObject("Outlook.Application")
Set myNameSpace = myOlapp.GetNamespace("MAPI")
Set myGAddressList = myNameSpace.AddressLists("Global Address List")
Set myGAddressEntries = myGAddressList.AddressEntries
For i = 1 To myGAddressEntries.Count
cmbEmail.AddItem (myGAddressEntries.Item(i).Name)
Next i

Tks again.
JP- I rate your help