Outlook Redemption and Offline Address Book

S

SeeMing

Using Redemption in VB, I would like to access Offline Address Book
(of current user session) without getting the security prompt.

Looking at the code below, obviously 'type mismatch' error is returned
when offline address book is returned. I wonder if there is a way to
set the Redemption session to current Outlook session (apart from
using MAPIOBJECT), and to retrieve the Offline address book?
Appreciate for a sample code. Many Thanks.


Dim oAddrList As Redemption.AddressList
Dim oAddrEntry As Redemption.AddressEntry

' get current namespace and session

Set m_oNS = gOLApp.GetNamespace("MAPI")
m_oNS.Logon ShowDialog:=False, NewSession:=False

Set m_oCDO = New MAPI.Session
m_oCDO.Logon ShowDialog:=False, NewSession:=False

' the following line returns type mismatch error

Set oAddrList = m_oCDO.AddressLists("Offline Address Book")
Set oAddrEntry =
oAddrList.AddressEntries(m_oNS.CurrentUser.AddressEntry.Name)

MsgBox oAddrEntry.Fields(CdoPR_ACCOUNT)
 
D

Dmitry Streblechenko

You don't to need to use CDO in this case: create an instance of
Redemption.AddressLists object and go from there.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top