Call [win32com.client.Dispatch] Fails with Lotus Notes 9.0.1/Windows 7 Pro/Python 3.6.1 RRS feed

  • General discussion

  • Hello and Good day,


    I need to connect to Lotus Notes (9.0.1FP7) and do some operations (Send/Receive mail with Attachments).

    However, I am not able to get past even the ‘Dispatch’ step:


    import os, sys, stat, shutil

    import os.path

    import string

    from configparser import SafeConfigParser

    import tempfile

    import logging

    import getpass

    import re

    import time

    from win32com.client import makepy

    from win32com.client import Dispatch

    import win32com.client

    import pywintypes

    import smtplib

    import csv # imports the csv module


    makepy.GenerateFromTypeLibSpec('Lotus Domino Objects')

    makepy.GenerateFromTypeLibSpec('IBM Notes Automation Classes')

    Session = win32com.client.Dispatch('Lotus.NotesSession')


    This rises an exception (Traceback)

    File ..\Anaconda3\Lib\site-packages\win32com\client\dynamic.py in _GetGoodDispatch

    IDispatch = pythoncom.connect(IDispatch)

    Pywinttypes.com.error: (-2147221021, ‘Operation unavailable’, None, None)


    During handling of above exception, another exception occurred:



    File My file

    Session = win32com.client.Dispatch('Lotus.NotesSession')

    File ..\Anaconda3\Lib\site-packages\win32com\client\__init__.py in Dispatch

      dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)

    File ..\Anaconda3\Lib\site-packages\win32com\client\dynamic.py in _GetGoodDispatchAndUserName

                return (_GetGoodDispatch(IDispatch, clsctx), userName)

    File ..\Anaconda3\Lib\site-packages\win32com\client\dynamic.py in  _GetGoodDispatch

                IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)

    pywinttypes.com.error: (-2147221164, ‘Class not registered’, None, None)



    Thanks in advance for any ideas or aid.



    • Changed type Bill_Stewart Wednesday, September 13, 2017 9:48 PM
    • Moved by Bill_Stewart Wednesday, September 13, 2017 9:48 PM This is not support forum for third party software
    Thursday, August 3, 2017 7:16 PM

All replies

  • Sorry this is not a Lotus forum.  You need to post in an IBM forum.  This is also not a Python forum.  Post is a forum for your version of Python.



    Thursday, August 3, 2017 7:40 PM
  • My only thought is that those COM objects exist on the 32-bit side and not the 64-bit side. If that's the case, then you would have to run your code from a 32-bit executable.

    But other than that - jrv is right that this forum focuses on Windows scripting and technologies rather than third party languages or applications.

    -- Bill Stewart [Bill_Stewart]

    Thursday, August 3, 2017 7:53 PM
  • Hi, 

    have you found a solution to this? I have the same problem.

    Wednesday, July 18, 2018 1:50 PM