[python-win32] get MAPI session from OOM

ckkart at hoc.net ckkart at hoc.net
Mon Jun 4 22:00:11 EDT 2018


Am 03/06/18 um 12:51 schrieb Christian K.:
> Am 2018-05-31 03:31, schrieb timr at probo.com:
>> On May 30, 2018, at 11:23 AM, ckkart at hoc.net wrote:
>>>
>>>
>>> Any ideas? Do you think it will help to do a fresh install of office
>>> 2016?
>>
>> In addition to just installing Outlook, have you configured Outlook?
>> You can't access MAPI unless you have incoming and outgoing servers
>> configured and authenticated.
> 
> I installed Office 2016 from scratch and still get the same error. But I
> could make a new observation. When running a standalone script
> 
> from win32com.client import Dispatch
> o = Dispatch('Outlook.Application')
> o.GetNamespace('MAPI').Session.MAPIOBJECT.QueryInterface(mapi.IID_IMAPISession)
> 
> 
> a window opens saying that there is no standard mail application
> defined. I checked in the system settings and changed the setting from
> the windows 10 mail app to outlook but I still get that error. I get it
> too when I initialize a MAPISession like this:
> 
> from win32com.mapi import mapi
> mapi.MAPIInitialize((0,mapi.MAPI_MULTITHREAD_NOTIFICATIONS))
> 

I got it. This was due to a very stupid mistake. I tried to connect to
32 bit office from 64 bit python. Sorry for the noise.

Christian



More information about the python-win32 mailing list