win32com.client.Dispatch("Outlook.Application")错误pywintypes.com_error:(-2147221005,“无效的类字符串",无,无) [英] win32com.client.Dispatch("Outlook.Application") error pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

查看:2216
本文介绍了win32com.client.Dispatch("Outlook.Application")错误pywintypes.com_error:(-2147221005,“无效的类字符串",无,无)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7上,并且已安装Windows Live. 现在,当我尝试运行以下代码

I am on windows 7 and I have windows live installed. Now when I am trying to run following code

import win32com.client
win32com.client.Dispatch("Outlook.Application")

我遇到以下错误

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 95, in
Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,c

    lsctx)
      File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 108, in
    _GetGoodDispatchAndUserName
        return (_GetGoodDispatch(IDispatch, clsctx), userName)
      File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 85, in _
    GetGoodDispatch
        IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.II
    D_IDispatch)
    pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

我有一台装有Windows XP和Outlook的计算机. 我运行了相同的代码,并且遇到了相同的错误.

I have another machine with windows xp and Outlook installed. I ran the same code and I got the same error.

还有一个问题. 如何在Windows 7上实时获取Windows的COM?

One more question. How can I get the com of windows live on windows 7?

任何建议和评论将不胜感激.

Any suggestions and comments will be appreciated.

推荐答案

这表明未安装Outlook. "windows live"或"outlook.com"对您没有帮助.

This is an indication that Outlook is not installed. "windows live" or "outlook.com" would not help you.

这篇关于win32com.client.Dispatch("Outlook.Application")错误pywintypes.com_error:(-2147221005,“无效的类字符串",无,无)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆