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 and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

MAPI Session Logon error



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 17th 08, 11:49 AM posted to microsoft.public.outlook.program_vba
AVIS
external usenet poster
 
Posts: 17
Default MAPI Session Logon error

Hi All,

I have a Visual Basic application which has the below code

Set Session = New MAPI.Session
ProfileInfo = ExchangeServer & vbLf & UserId
Call Session.Logon(, , False, , , , sProfileInfo)
Set Contacts = Session.GetDefaultFolder(CdoDefaultFolderContacts)

It is working fine in my PC with WINDOWS XP Professional and OUTLOOK 2003.

But the "Set oContacts = ..", given in the above coding snapshot returns an
error message, in one of the user's PC. The error is happening in a system
with WINDOWS 2003 and OUTLOOK 2007. When I replace the statement "Call
oSession.Logon(, , False, , , , sProfileInfo)" with the statement as
Call oSession.Logon(, , True, False), it is working fine

Can anyone tell me, why this is happening, is it some envvironment issue?

I cant change the code in the application, since this is the only user, who
is having the problem and the others (I hope all are using WINDOWS XP, with
OUTLOOK 2003) are not having the problem.
  #2  
Old April 17th 08, 02:00 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default MAPI Session Logon error

Did you actually install CDO 1.21 on the Outlook 2007 system? It is a separate download.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"AVIS" wrote in message news
Hi All,

I have a Visual Basic application which has the below code

Set Session = New MAPI.Session
ProfileInfo = ExchangeServer & vbLf & UserId
Call Session.Logon(, , False, , , , sProfileInfo)
Set Contacts = Session.GetDefaultFolder(CdoDefaultFolderContacts)

It is working fine in my PC with WINDOWS XP Professional and OUTLOOK 2003.

But the "Set oContacts = ..", given in the above coding snapshot returns an
error message, in one of the user's PC. The error is happening in a system
with WINDOWS 2003 and OUTLOOK 2007. When I replace the statement "Call
oSession.Logon(, , False, , , , sProfileInfo)" with the statement as
Call oSession.Logon(, , True, False), it is working fine

Can anyone tell me, why this is happening, is it some envvironment issue?

I cant change the code in the application, since this is the only user, who
is having the problem and the others (I hope all are using WINDOWS XP, with
OUTLOOK 2003) are not having the problem.

  #3  
Old April 18th 08, 05:41 AM posted to microsoft.public.outlook.program_vba
AVIS
external usenet poster
 
Posts: 17
Default MAPI Session Logon error

Yupe, I have got CDO 1.21 installed. But still it is not working.

"Sue Mosher [MVP-Outlook]" wrote:

Did you actually install CDO 1.21 on the Outlook 2007 system? It is a separate download.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"AVIS" wrote in message news
Hi All,

I have a Visual Basic application which has the below code

Set Session = New MAPI.Session
ProfileInfo = ExchangeServer & vbLf & UserId
Call Session.Logon(, , False, , , , sProfileInfo)
Set Contacts = Session.GetDefaultFolder(CdoDefaultFolderContacts)

It is working fine in my PC with WINDOWS XP Professional and OUTLOOK 2003.

But the "Set oContacts = ..", given in the above coding snapshot returns an
error message, in one of the user's PC. The error is happening in a system
with WINDOWS 2003 and OUTLOOK 2007. When I replace the statement "Call
oSession.Logon(, , False, , , , sProfileInfo)" with the statement as
Call oSession.Logon(, , True, False), it is working fine

Can anyone tell me, why this is happening, is it some envvironment issue?

I cant change the code in the application, since this is the only user, who
is having the problem and the others (I hope all are using WINDOWS XP, with
OUTLOOK 2003) are not having the problem.


  #4  
Old April 17th 08, 02:19 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default MAPI Session Logon error

So the Session instantiates when using ShowDialog? Does the user enter their
normal logon in that dialog?

Do the parameters for the dynamic logon look valid on the problem machine?
How are you deriving ExchangeServer and UserId?

In general, when using a dynamic logon (where UserId must match the existing
mailbox name) you'd use something like this:

Session.Logon "", "", False, True, 0, False, sProfileInfo


--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"AVIS" wrote in message
news
Hi All,

I have a Visual Basic application which has the below code

Set Session = New MAPI.Session
ProfileInfo = ExchangeServer & vbLf & UserId
Call Session.Logon(, , False, , , , sProfileInfo)
Set Contacts = Session.GetDefaultFolder(CdoDefaultFolderContacts)

It is working fine in my PC with WINDOWS XP Professional and OUTLOOK 2003.

But the "Set oContacts = ..", given in the above coding snapshot returns
an
error message, in one of the user's PC. The error is happening in a
system
with WINDOWS 2003 and OUTLOOK 2007. When I replace the statement "Call
oSession.Logon(, , False, , , , sProfileInfo)" with the statement as
Call oSession.Logon(, , True, False), it is working fine

Can anyone tell me, why this is happening, is it some envvironment issue?

I cant change the code in the application, since this is the only user,
who
is having the problem and the others (I hope all are using WINDOWS XP,
with
OUTLOOK 2003) are not having the problem.


  #5  
Old April 18th 08, 05:47 AM posted to microsoft.public.outlook.program_vba
AVIS
external usenet poster
 
Posts: 17
Default MAPI Session Logon error

For the first question, No, the user specifies the admin details of the
exchange server

The server details are from the database and the same details are used by
other users, where the program is working fine.

"Ken Slovak - [MVP - Outlook]" wrote:

So the Session instantiates when using ShowDialog? Does the user enter their
normal logon in that dialog?

Do the parameters for the dynamic logon look valid on the problem machine?
How are you deriving ExchangeServer and UserId?

In general, when using a dynamic logon (where UserId must match the existing
mailbox name) you'd use something like this:

Session.Logon "", "", False, True, 0, False, sProfileInfo


--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"AVIS" wrote in message
news
Hi All,

I have a Visual Basic application which has the below code

Set Session = New MAPI.Session
ProfileInfo = ExchangeServer & vbLf & UserId
Call Session.Logon(, , False, , , , sProfileInfo)
Set Contacts = Session.GetDefaultFolder(CdoDefaultFolderContacts)

It is working fine in my PC with WINDOWS XP Professional and OUTLOOK 2003.

But the "Set oContacts = ..", given in the above coding snapshot returns
an
error message, in one of the user's PC. The error is happening in a
system
with WINDOWS 2003 and OUTLOOK 2007. When I replace the statement "Call
oSession.Logon(, , False, , , , sProfileInfo)" with the statement as
Call oSession.Logon(, , True, False), it is working fine

Can anyone tell me, why this is happening, is it some envvironment issue?

I cant change the code in the application, since this is the only user,
who
is having the problem and the others (I hope all are using WINDOWS XP,
with
OUTLOOK 2003) are not having the problem.



  #6  
Old April 18th 08, 02:05 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default MAPI Session Logon error

Does that user have the same permissions as other users? Are you sure that
the user is using the correct alias and that they have permissions for that
alias? Did you try the suggestion I made about changing the logon arguments?

With a CDO logon it's a matter of permissions and getting your parameters
correct.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"AVIS" wrote in message
news
For the first question, No, the user specifies the admin details of the
exchange server

The server details are from the database and the same details are used by
other users, where the program is working fine.


  #7  
Old April 21st 08, 09:07 AM posted to microsoft.public.outlook.program_vba
AVIS
external usenet poster
 
Posts: 17
Default MAPI Session Logon error

I dont think, there is anything related to the permission of the user.
Because, if i set the code, in such a way that the profile name is
selectable, then the code works fine, or else it doesnt. This happens only
in this system. All other system, the profile name is not selectable, but
the code works fine....

"Ken Slovak - [MVP - Outlook]" wrote:

Does that user have the same permissions as other users? Are you sure that
the user is using the correct alias and that they have permissions for that
alias? Did you try the suggestion I made about changing the logon arguments?

With a CDO logon it's a matter of permissions and getting your parameters
correct.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"AVIS" wrote in message
news
For the first question, No, the user specifies the admin details of the
exchange server

The server details are from the database and the same details are used by
other users, where the program is working fine.



  #8  
Old April 29th 08, 08:39 AM posted to microsoft.public.outlook.program_vba
AVIS
external usenet poster
 
Posts: 17
Default MAPI Session Logon error

Any Updates?

"AVIS" wrote:

I dont think, there is anything related to the permission of the user.
Because, if i set the code, in such a way that the profile name is
selectable, then the code works fine, or else it doesnt. This happens only
in this system. All other system, the profile name is not selectable, but
the code works fine....

"Ken Slovak - [MVP - Outlook]" wrote:

Does that user have the same permissions as other users? Are you sure that
the user is using the correct alias and that they have permissions for that
alias? Did you try the suggestion I made about changing the logon arguments?

With a CDO logon it's a matter of permissions and getting your parameters
correct.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"AVIS" wrote in message
news
For the first question, No, the user specifies the admin details of the
exchange server

The server details are from the database and the same details are used by
other users, where the program is working fine.



  #9  
Old April 21st 08, 10:04 AM posted to microsoft.public.outlook.program_vba
SvenC[_2_]
external usenet poster
 
Posts: 40
Default MAPI Session Logon error

Hi AVIS,

Set Session = New MAPI.Session
ProfileInfo = ExchangeServer & vbLf & UserId


If you have two userIds where one is the prefix of another
you cannot log on to the short userID with a dynamic
profile, because the two userIDs are counted as valid and none
is chosen automatically.

So if you have something like

"user" and "userA" you will not be able to log on with user
with a dynamic profile.

This got more complex with Exchange = 2000 because several
AD properties of a user are looked up. So the mailbox alias is only
one attribute to look at. We had problems with the windows logon
name as well.

So please verify if the problematic system is really the system or
if you just use a userID which is a prefix of another mailbox alias
or user name.

--
SvenC
  #10  
Old April 21st 08, 03:13 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default MAPI Session Logon error

Actually, it should be possible to do that by prefixing the userID with "=" to force an exact match, e.g. "=" & UserId

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"SvenC" wrote in message ...
Hi AVIS,

Set Session = New MAPI.Session
ProfileInfo = ExchangeServer & vbLf & UserId


If you have two userIds where one is the prefix of another
you cannot log on to the short userID with a dynamic
profile, because the two userIDs are counted as valid and none
is chosen automatically.

So if you have something like

"user" and "userA" you will not be able to log on with user
with a dynamic profile.

This got more complex with Exchange = 2000 because several
AD properties of a user are looked up. So the mailbox alias is only
one attribute to look at. We had problems with the windows logon
name as well.

So please verify if the problematic system is really the system or
if you just use a userID which is a prefix of another mailbox alias
or user name.

--
SvenC

 




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
CDO Outlook security prompt hangs, vb script Mapi Session [email protected] Outlook and VBA 2 April 17th 08 11:03 AM
OLK2007 : The Oper Failed : Application.CreateObject("MAPI.Session Bill Billmire Outlook - Using Forms 3 January 7th 07 01:02 AM
Redemption+CBuilder: RDOSession.Logon MAPILogonEx-Error [email protected] Add-ins for Outlook 2 September 1st 06 08:32 AM
MAPI error jackie Outlook - Using Forms 0 August 18th 06 04:28 PM
Error creating an MAPI session Dominique Schroeder Outlook - Using Forms 1 March 7th 06 02:25 PM


All times are GMT +1. The time now is 03:39 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.