
Accessing the Global Address List using VBA
CDO is an optional installation with Outlook 2000 and later. You have
to select to install it from the Office CD under the Outlook section.
You might want to look at the ItemsCB COM addin sample on the
Resources page at www.microeye.com, it has code to demand load CDO if
it's not already installed. The user would need access to the Office
installation point of course.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
Quote:
> Hi,
> We have written a database application that refers to users and
e-mail
> addresses in several locations. We have a customer who wants to use
a
> modified version of this application but they do not want to
populate and
> maintain the user and e-mail information since the company has over
50000
> employees and has all this information already stored in its
Exchange
> servers.
> So, I wanted to pop-up the Global Address List whenever data is
required and
> use the returned information in my application. I can recall using
the
> following demo code to obtain this but the code no longer seems to
work.
> Even creating the MAPI session doesn't work. What am I missing here?
> I'm running Windows XP (Service Pack 1 installed) with Office XP and
I
> thought no further action was required. Do I still have to install
CDO and
> if so which version and where can I find it?
> Thanks a lot!
> Alain
> Belgium
> Private Sub Command1_Click()
> Set A = CreateObject("MAPI.Session")
> S = A.Logon
> On Error GoTo err_AddressBook
> Set R = A.AddressBook
> For i = 1 To R.Count
> R.Item(i).resolve
> Print (R.Item(i).AddressEntry.Name)
> Next i
> Exit Sub
> err_AddressBook:
> If (Err <> &H80040113) Then MsgBox "Unrecoverable Error: " & Err
> End Sub