I am trying to automatically open a Word Document in Python. I am very new to programming and I heard this site helped people who had trouble with it.
I have looked at various questions and have found this:
DummyFile = path_to_docx
with open(DummyFile) as f:
source_stream = io(f.read())
document = doc(source_stream)
source_stream.close()
But when I run it, I get:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 74: character maps to <undefined>
It seems that this code is not what I want. I believe it is trying to read my document and put it into a variable. Not what I want. I want the command, that when executed, will open the word document in Microsoft Word
Expected Result:
Word Document opens in Microsoft Word, as can be seen here: