This code in Python is not working:
from comtypes import client
word = client.CreateObject("Word.Application")
word.Documents.Open("C:\\test.docx")
I get this error message:
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
doc = word.Documents.Open("test.docx")
AttributeError: 'POINTER(IUnknown)' object has no attribute 'Documents'
Similar code using the class Excel.Appliation also gives the same kind of error. Another test with InternetExplorer.Application worked. So it seems a problem of Office.
I also tested the same code in VBScript and worked.
The code works in Windows7-64bits and Office 2013. The computer where it is not working is Windows10-64bits and Office 365. The Python version in both computers is 3.6-64bits.