Problem with creating MAPI session

C

Chad Parks

I am trying to run this code:

<%@ Language = VBscript %>

<%

' Create MAPI session
Set objSession = CreateObject("MAPI.Session")

' Logon using an existing MAPI session
objSession.Logon "", "", False, False, 0

' Get folder where the current Outlook item lives
Set objFolder = Item.Parent

' Get the Outlook item with CDO
Set objMessage = objSession.GetMessage(Item.EntryID, objFolder.StoreID)

' Get the sender of the message
Set objSender = objMessage.Sender

' Pull out some properties of the sender
MsgBox "Sender name: " & objSender.Name
MsgBox "Sender address: " & objSender.Address

' Close MAPI session
objSession.Logoff

%>


<html>
<head>
<title>Outlook Mail Test</title>
</head>
<body>
</body>
</html>

Can anyone tell me what this error means and how to correct it please:

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 'MAPI.Session'

/mailtest.asp, line 6


Line 6 = Set objSession = CreateObject("MAPI.Session")

Thanks for your help!!

Chad Parks
 
S

Sue Mosher [MVP-Outlook]

Most likely it means that CDO is not installed on the machine where the code
is running.
 

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