Solved

CDO and the Address book

Posted on 2001-07-05
3
336 Views
Last Modified: 2008-03-17
Using MAPI I can open the address book using

MAPIMessage.Action = vbMessageShowAddressBook

and then with code copy the selected addresses into a variable

How can I achieve the same using CDO 1.x

0
Comment
Question by:mutrus
  • 2
3 Comments
 
LVL 16

Expert Comment

by:Neo_mvps
Comment Utility
' Using CDO 1.x

' Explicit declares require one to add a reference to the
' CDO library

Dim oSession As MAPI.Session
Dim oRecipients As MAPI.Recipients

Set oSession = CreateObject("MAPI.Session")

' logon to the session
oSession.Logon "Profile", "Password", False, False

' if Outlook is already running then we could have done
' the following to piggy back on existing session
' oSession.Logon "","", False, False


' Recipients is a collection
Set oRecipients = oSession.AddressBook

' warning if user presses the cancel button, it will
' raise an error that you will have to catch and handle

0
 
LVL 16

Accepted Solution

by:
Neo_mvps earned 100 total points
Comment Utility
Changing comment to answer...
0
 

Author Comment

by:mutrus
Comment Utility
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now