@
FanWall @
yankebupt 谢谢两位!
我按文档里的注册了 dll
https://sites.google.com/a/deskperience.com/wordcapturexdoc/wcapturex/register-wcapturex我的命令
C:\Users\i>regsvr32 "C:\Program Files\WordWeb\WCaptureX.dll"
然后我的代码
from win32com.client import Dispatch
zk = Dispatch("WCaptureX")
估计也不对,出现如下异常
Traceback (most recent call last):
File "C:\Users\i\AppData\Local\Programs\Python\Python36-32\lib\site-packages\win32com\client\
dynamic.py", line 89, in _GetGoodDispatch
IDispatch = pythoncom.connect(IDispatch)
pywintypes.com_error: (-2147221005, '无效的类字符串', None, None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\BaiduYunDownload\编程\Python\
Win32COM.py", line 3, in <module>
zk = Dispatch("WCaptureXLib")
File "C:\Users\i\AppData\Local\Programs\Python\Python36-32\lib\site-packages\win32com\client\
__init__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File "C:\Users\i\AppData\Local\Programs\Python\Python36-32\lib\site-packages\win32com\client\
dynamic.py", line 114, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:\Users\i\AppData\Local\Programs\Python\Python36-32\lib\site-packages\win32com\client\
dynamic.py", line 91, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221005, '无效的类字符串', None, None)
[Finished in 1.2s]