Global address list

S

Sakinah

hello all,
how to populate name in global address list into combobox in custom form. i
have run this code below but not return any value:

' Constant for global address list
Const CdoAddressListGAL = 0

' Get global address list
Set objSession = CreateObject("MAPI.Session")

' Logon using an existing MAPI session
objSession.Logon "", "", False, False, 0

Set objAddressList = objSession.GetAddressList(CdoAddressListGAL)

' Get address entries of the global address list
Set objAddressEntries = objAddressList.AddressEntries

' Loop through the address entries collection
For Each objAddressEntry In objAddressEntries
' Add each address entry to the combo box
myComboBox.AddItem objAddressEntry.Name
Next
 

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