I am using python 3.4 on windows 7. In order to open a doc file I am using this code:
import sys
import win32com.client as win32
word = win32.Dispatch("Word.Application")
word.Visible = 0
word.Documents.Open("MyDocument")
doc = word.ActiveDocument
I'M not sure why is this error popping up every time:
ImportError: no module named win32api
Although I have installed pywin32 from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32 and I have also checked the path from where I am importing. I have tried reinstalling pywin32 as well but that doesn't remove the error.
import win32api
directly from an interactive interpreter. And, while we're at it,import importlib; print(importlib.util.find_spec('win32api')
) – Schoolfellow