Hi,
Am trying to display global address list thru an asp page but when trying with below piece of code am getting MAPI
not supported error when accessing address book.
Please let me know where am doing wrong.
<%
Const cdoE_USER_CANCEL = &H80040113
Dim objSession
Dim objAddrEntries
Dim objAddressEntry
Dim strProfileInfo
Dim colCDORecips
strProfileInfo = strServer & vbLf & strMailbox
' start CDO session
Set objSession = CreateObject("MAPI.Session")
objSession.Logon , , False, True, 0, True, strProfileInfo
'objSession.Logon , , False, False
'On Error Resume Next
Set colCDORecips = objSession.AddressBook(, _
"Pick a Name", , , 1, _
"My Choice")
If Err = 0 Then
If colCDORecips.Count <> 1 Then
MsgBox "Please choose exactly 1 name.", , _
"Chose One Name"
Else
strName = _
colCDORecips.Item(1).AddressEntry.Name
End If
ElseIf Err = cdoE_USER_CANCEL Then
End If
GetOneNameViaCDO = strName
objSession.Logoff
Set colCDORecips = Nothing
Set objSession = Nothing
%>