Answered by:
Outlook 2016 and MAPI

Question
-
Hello,
which versions of Outlook 2016 do support MAPI?
Monday, April 24, 2017 1:03 PM
Answers
-
It is not a good idea to unload the MAPI system and then load it again. You'd be better off to always have it loaded until your app terminates.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!- Proposed as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Thursday, April 27, 2017 9:16 AM
- Marked as answer by psc161 Thursday, April 27, 2017 9:17 AM
Wednesday, April 26, 2017 10:26 PM
All replies
-
-
But some of our customers (with presumably a "Click-To-Run" version of Outlook 2016) are reporting that the MAPI functions of our software don't work.
And according to this page, at least the "Click-To-Run" versions of Outlook 2010 didn't support MAPI:
Unfortunately I was not able to find a similar page with information about Outlook 2016.
Monday, April 24, 2017 1:35 PM -
You need to make sure you are loading the MAPI system correctly. Does MFCMAPI (of the appropriate bitness) run in their environment? If yes, see how MFCMAPI loads the MAPI system.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!Monday, April 24, 2017 4:57 PM -
We are currently using "MAPIStubLibrary" (https://github.com/stephenegriffin/MAPIStubLibrary).
Is this deprecated?
Tuesday, April 25, 2017 7:26 AM -
That is what you need to be using. Are you running into a particular problem?
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!Tuesday, April 25, 2017 3:18 PM -
Yes, but its complicated. I try to explain what I found out after further investigating.
Our code calls this function sequence every time it sends a mail:
GetPrivateMAPI
MAPIInitialize
... lots of MAPI functions ...
MAPIUninitialize
UnLoadPrivateMAPIThe very first mail is sent without problems. For the second mail the program stops after "MAPIInitialize" with a message box that Outlook has to be repaired.
What happenes is that for the first mail "GetPrivateMAPI" returns "msmapi.dll". During the sequence "olmapi32.dll" is also loaded into the process space.
"UnLoadPrivateMAPI" then unloads "msmapi.dll", but "olmapi32.dll" does not get unloaded automatically.So for the second mail "GetPrivateMAPI" returns "olmapi32.dll" and this seems to cause the problem.
The problem did not occur with older Outlook versions. I tested it for example with Outlook 2007. There "GetPrivateMAPI" returns "olmapi32.dll" already with the first mail.
As a workaround I now have moved the call to "UnLoadPrivateMAPI" to the ending of our program.
Wednesday, April 26, 2017 7:39 AM -
It is not a good idea to unload the MAPI system and then load it again. You'd be better off to always have it loaded until your app terminates.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!- Proposed as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Thursday, April 27, 2017 9:16 AM
- Marked as answer by psc161 Thursday, April 27, 2017 9:17 AM
Wednesday, April 26, 2017 10:26 PM