Answer the question
In order to leave comments, you need to log in
How to connect to word from python?
Here is the code
import win32com.client as client
import pythoncom, os
pythoncom.CoInitialize()
word = client.Dispatch('Word.Application')
doc = word.Documents.Open(os.path.abspath(document_word))
doc.SaveAs(os.path.abspath(document_pdf), FileFormat=17)
doc.Close()
word.Quit()
pythoncom.CoUninitialize()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question