I've seen around alot of forum and needing help on how to retrieve address book for VB project, I've put together piece by piece and viola it works, only need "Microsoft Outlook xx.x Object Library - I used 10.0)
[color green]'create an listbox (i named it ab - Address Book)[/color]
[color blue]Option Explicit
Dim ola As Outlook.AddressList
Dim ole As Outlook.AddressEntry
Private Sub address_book_Click()
On Error Resume Next
Set ola = Application.Session.AddressLists("Contacts")[/color] [color green]'Contact is the name of your address book[/color]
[color blue]For Each ole In ola.AddressEntries
ab.AddItem ole
Next
Set ola = Nothing
Set ole = Nothing
End Sub[/color]
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.