View Single Post
  #3  
Old April 17th 08, 02:19 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,426
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.


Ads
 

Credit - Ringtones - Mortgage Loans - Mortgage Calculator - Ringtones