|
 |
asp_cdo thread: Can I use the Outlook Addressbook in webpage?
Message #1 by "Jeff G" <lists@2...> on Sat, 23 Dec 2000 18:43:28 -0000
|
|
Anyway to make the client-side vbscript below work? Like to have user s
select a contact from the local outlook addressbook then have their
selection(s) be returned back to a text input field in a webpage. Any
ideas?
<SCRIPT LANGUAGE=vbscript>
On Error GoTo ErrorHandler
Dim gCDOSession
Set gCDOSession = CreateObject("MAPI.Session")
gCDOSession.Logon()
Set eNCOUNTER_Recipients = gCDOSession.AddressBook()
'Use msgbox below to deplay contact info select from addressbook.
msgbox(eNCOUNTER_Recipients(1))
ErrorHandler:
If Err.Number <> CdoE_USER_CANCEL Then
Err.Raise Err.Number
End If
</SCRIPT>
Thanks in advance,
Jeff
jeff@2...
---
http://www.asptoday.com - the leading site for timely,
in-depth information for ASP developers everywhere.
---
You are currently subscribed to asp_cdo as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_cdo-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #2 by Thang Nguyen <nnthang_htc@y...> on Sat, 23 Dec 2000 21:46:59 -0800 (PST)
|
|
Basically, you can get address book (recipient list)
from Exchange Server address book by using MAPI in
ASP:
<%
On Error Resume Next
BAuthenticateUser
Err.Clear
'Set objAMSession1 = Application("MAPISession")
set objAMSession1
Server.CreateObject("MAPI.Session")
If Not ReportError( "create MAPI.Session") Then
set objRenderApp = Application(
"RenderApplication" )
strLogonID = Request.ServerVariables("Logon_User")
bstrMailbox = Right(strLogonID, Len(strLogonID) -
InStr(strLogonID, "\"))
bstrProfileInfo = YourServerName + vbLF +
bstrMailbox
Err.Clear
objAMSession1.Logon "", "", False, True, 0, True,
bstrProfileInfo
If Not ReportError( "ActiveMessaging Logon") Then
Err.Clear
Set objInbox = objAMSession1.Inbox
If ReportError( "Get Inbox") Then
' The logon is no good.
Set objAMSession1 = Nothing
End If
Set Session("AMSession") = objAMSession1
Session("hImp") = objRenderApp.ImpID
End If 'objAMSession1.Logon
End If 'Server.CreateObject()
Set objMyPAB = objAMSession1.AddressLists(1)
Set objEntries=objMyPAB.AddressEntries
...
%>
--- Jeff G <lists@2...> wrote:
> Anyway to make the client-side vbscript below work?
> Like to have user s
> select a contact from the local outlook addressbook
> then have their
> selection(s) be returned back to a text input field
> in a webpage. Any
> ideas?
>
> <SCRIPT LANGUAGE=vbscript>
> On Error GoTo ErrorHandler
>
> Dim gCDOSession
> Set gCDOSession = CreateObject("MAPI.Session")
> gCDOSession.Logon()
>
> Set eNCOUNTER_Recipients = gCDOSession.AddressBook()
>
>
> 'Use msgbox below to deplay contact info select from
> addressbook.
> msgbox(eNCOUNTER_Recipients(1))
>
> ErrorHandler:
>
> If Err.Number <> CdoE_USER_CANCEL Then
> Err.Raise Err.Number
> End If
> </SCRIPT>
>
> Thanks in advance,
>
> Jeff
> jeff@2...
>
---
http://www.asptoday.com - the leading site for timely,
in-depth information for ASP developers everywhere.
---
You are currently subscribed to asp_cdo as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_cdo-$subst('Recip.MemberIDChar')@p2p.wrox.com
|
|
 |