Re: Problem with creating MAPI session

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Sue Mosher [MVP-Outlook] (suemvp_at_outlookcode.com)
Date: 10/26/04


Date: Tue, 26 Oct 2004 12:44:44 -0400

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

-- 
Sue Mosher, Outlook MVP
Author of
     Microsoft Outlook Programming - Jumpstart for
     Administrators, Power Users, and Developers
     http://www.outlookcode.com/jumpstart.aspx
"Chad Parks" <Chad Parks@discussions.microsoft.com> wrote in message 
news:BC31CACF-C238-4E35-860D-0FF832A428C1@microsoft.com...
>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
>
>
>
> 


Relevant Pages

  • Re: Possible to Disable Object Model Guard?
    ... Author of Microsoft Outlook 2007 Programming: ... Message.Configuration details for CDO. ... Dim OutMail As Object ... Dim cell As Range, FileCell As Range, rng As Range ...
    (microsoft.public.outlook.program_vba)
  • Re: Searching items in non-visible folder?
    ... Then you most definitely don't have CDO installed on that system. ... expand the Outlook section and ensure that Collaboration Data ... >> If you logon using an existing profile, ... >>> items in the folder looking for the messages that I want? ...
    (microsoft.public.outlook.program_forms)
  • Re: populating fields with information from the address book
    ... I downloaded a CDO for a separate MS issue last May. ... and installed separately on each Outlook 2007 machine that needs it. ... Sue Mosher, Outlook MVP ... '* thus if a new item, then composemode set in global settings remains ...
    (microsoft.public.outlook.program_forms)
  • Re: CDO and Redemption Works in Outlook 2002 but crashes in Outlook 2000
    ... Are the users with Outlook 2000 using it in Internet only mode? ... the CDO Session.AddressBook and Redemption's MAPIUtils.AddressBook methods ... Dim m_redMapiUtils As Redemption.MAPIUtils ... Set redRecipients = Nothing ...
    (microsoft.public.exchange.development)
  • Re: Sending Email to freehand address
    ... I have actually used CDO before. ... personally have Outlook 2003 installed, however, another computer that I am ... Public Function SendOutlookMail(ByVal sTo As String, sSubject As String, ... If lPosition = 0 Then ...
    (microsoft.public.vb.winapi)