Add a reference to Outlook in your project. Then try something like:
Private Sub Command1_Click()
Dim myOlApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myAddresslist As Outlook.AddressList
Dim myAddressentry As Outlook.AddressEntry
Dim myCounter
myCounter = 1
Set myOlApp = CreateObject("Outlook.Application"
Set myNamespace = myOlApp.GetNamespace("MAPI"
Set myAddresslist = myNamespace.AddressLists(1)
For Each myAddressentry In myAddresslist.AddressEntries
Set myAddressentry = myAddresslist.AddressEntries(myCounter)
List1.AddItem myAddressentry
Set myAddressentry = Nothing
myCounter = myCounter + 1
Next
myOlApp.Quit
Set myOlApp = Nothing
End Sub
This is an outline only and as such has no error checking - it only assumes a command button and a listbox on a form!
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.