M Chen
M Chen

Reputation: 133

Python: package docx can't open a docx

I want to use python to open a word. I use win32com and it works. I find a package named docx and I really think it is very useful. But when I used it to open a wordfile, it raised valueError.

valueError: file '1.doc' is not a Word file, content type is 'applicationnd.openxmlformats-officedocument.themeManager+xml'

Upvotes: 0

Views: 7660

Answers (1)

user7609283
user7609283

Reputation:

Similar problem discussed here: can't open a .docx file #229
It looks like that it doesn't work with old doc files.
Try converting the doc file to docx - as lieuzhenghong did in the link - see if that solves the error

Upvotes: 3

Related Questions