A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Error creating an MAPI session



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 7th 06, 02:58 PM posted to microsoft.public.outlook.program_forms
Dominique Schroeder
external usenet poster
 
Posts: 1
Default Error creating an MAPI session

Here is the code below; I have problems with some machines and not others,
see comments in the code

thanks,

Dominique

sub item_open()

dim oSession 'MAPI session

dim strRetCode 'code to capture CDO success login



'clear error buffer

err.clear

on error resume next


'Use createobject to logon the CDO

' Need to use CDO to access access rights to MAPI folders

set oSession = application.createobject("MAPI.Session")

----- this is where it fails on some machines. Those are Office 2000 or
Office 2003 some have SP3 installed, one has SR1 (XP and windows 2000)

----- The error I get is -2147221005 Internal Application error

if not err.number = 0 then

msgbox err.number & " " & err.description

end if

'clear error buffer

err.clear

on error resume next

'Logon using an existing MAPI session

strRetCode=oSession.Logon("", "", false, false,0)

'error detected?

if not err.number = 0 then

msgbox "Could not establish CDO session"

oSession.logoff

Item_open = false

set oSession = nothing

strRetCode=0

exit sub

end if


etc...

end sub


Ads
  #2  
Old March 7th 06, 03:25 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Error creating an MAPI session

Have you checked to see if those machines (a) have CDO 1.21 installed and (b) are running an anti-virus program that includes a script blocker to prevent OUtlook or CDO automation?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Dominique Schroeder" wrote in message ...
Here is the code below; I have problems with some machines and not others,
see comments in the code

thanks,

Dominique

sub item_open()

dim oSession 'MAPI session

dim strRetCode 'code to capture CDO success login



'clear error buffer

err.clear

on error resume next


'Use createobject to logon the CDO

' Need to use CDO to access access rights to MAPI folders

set oSession = application.createobject("MAPI.Session")

----- this is where it fails on some machines. Those are Office 2000 or
Office 2003 some have SP3 installed, one has SR1 (XP and windows 2000)

----- The error I get is -2147221005 Internal Application error

if not err.number = 0 then

msgbox err.number & " " & err.description

end if

'clear error buffer

err.clear

on error resume next

'Logon using an existing MAPI session

strRetCode=oSession.Logon("", "", false, false,0)

'error detected?

if not err.number = 0 then

msgbox "Could not establish CDO session"

oSession.logoff

Item_open = false

set oSession = nothing

strRetCode=0

exit sub

end if


etc...

end sub


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofill not working in Terminal Session jcharde Outlook - General Queries 0 February 22nd 06 10:27 PM
mapi cdo service [email protected] Outlook - General Queries 8 February 20th 06 03:33 PM
limit number of messages sent in 1 session Andrew Zenz Outlook - General Queries 2 February 15th 06 07:53 PM
MAPI setup Jo Outlook - Installation 2 February 14th 06 08:51 PM
How to use MAPI with an ISP RGR. Jim Outlook - Installation 2 February 1st 06 08:57 PM


All times are GMT +1. The time now is 08:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.