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
 
Top