Solved

Mapi doesn't work when exchange/outlook session not running?

Posted on 2000-03-21
3
239 Views
Last Modified: 2013-12-25
My program reads and saves emails using mapi controls. But for me to run my program I have to have microsoft outlook or exchange running on my desktop. If I don't have a session running, the program doesn't work and gives error. How do I eliminate this problem?
thanks,
osho
0
Comment
Question by:osho121097
3 Comments
 
LVL 2

Expert Comment

by:brice123
ID: 2643405
Are you using the MAPI controls provided wihth VB6?

In this case, I suppose you are using a MAPI Session control. Try to set its NewSession property to true.

(The NewSession property specifies whether a new mail session should be established. If a valid session is already established, setting the NewSession property will allow two sessions to run concurrently).
0
 

Author Comment

by:osho121097
ID: 2648844
Yes, I am using Mapi with VB6. I tried your modification but still it doesn't work. Please let me know if you think there is any other reason. Thanks
0
 

Accepted Solution

by:
scrumper64 earned 50 total points
ID: 2692880
This works for me:

Mapi.DownloadMail = False
Mapi.NewSession = True
Mapi.LogonUI = False
Mapi.UserName = strLogonId
Mapi.Password = strPassword
Mapi.SignOn

It seems to ignore the password though, so set that to blank.  The password could be your problem, make sure the account can be opened OK without having to enter a password.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now