*RESOLVED* CDO 1.21 problems after security update
A client asked for word templates, which use the exchange server's global address list to get address information.
The method that used to work, doesn't work anymore when the CDO security patch is installed.
The configuration is:
Outlook 2000
Word 97
Exchange server (5.5?)
I am using the AddressBook method of CDO's session object.
According to Microsofts documentation, a dialog box should appear, asking the user to allow access to the address list.
This dialog box does not appear, instead a runtime error occurs as soon as I try to read the selected recipient.
The error is E_ACCESSDENIED(80070005)
Why doesn't the dialog box appear, and is access blocked?
Should I tell my client that the job can't be done?
Here is the sample code I used:
VB Code:
Private Sub CommandButton1_Click()
Dim ses As MAPI.Session
Dim recs As MAPI.Recipients
Dim rec As MAPI.Recipient
Set ses = New MAPI.Session
ses.Logon "MS Exchange Settings"
Set recs = ses.AddressBook(, "Selecteer een ontvanger", 1, 1, 1)
Set rec = recs.Item(1) ' this is where i get the error
Me.txtAchternaam.Text = rec.Name
Set rec = Nothing
Set recs = Nothing
ses.Logoff
Set ses = Nothing
End Sub
Any information is appreciated.
I am also open for alternative methods to read the exchange server's global address list, but I need to be able to access several exchange specific fields in the addressentry, so using the Outlook object model is not an option.