Earlier today I downloaded the pywin package to work with Microsoft Outlook. On the below code I received Error -2147221005. I'm uncertain if this has to do with an installation of the library not working properly/version issues. I use a 32 bit version of Python 3.7.
*Python Code:* import win32com.client as client outlook = client.Dispatch("Outlook Application") message = outlook.CreateItem(0) message.Display() *Full Error Message:* Traceback (most recent call last): File "C:\Users\Eric\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32com\client\dynamic.py", line 81, in _GetGoodDispatch IDispatch = pythoncom.connect(IDispatch) pywintypes.com_error: (-2147221005, 'Invalid class string', None, None) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "Outlook_text_text.py", line 2, in <module> outlook = client.Dispatch("Outlook Application") File "C:\Users\Eric\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) File "C:\Users\Eric\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32com\client\dynamic.py", line 98, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName) File "C:\Users\Eric\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32com\client\dynamic.py", line 83, in _GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) pywintypes.com_error: (-2147221005, 'Invalid class string', None, None) Thanks in advance. Best, Eric
_______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32