Question

I can't find any documentation describing how to read docx files with python. Does anyone have an example they would supply please?

path = 'C:\'
fn = 'file.docx'
Was it helpful?

Solution

Try this link:

http://www.darkcoding.net/software/printing-word-and-pdf-files-from-python/

from win32com import client
    import time

    word = client.Dispatch("Word.Application")

    def printWordDocument(filename):

        word.Documents.Open(filename)
        word.ActiveDocument.PrintOut()
        time.sleep(2)
        word.ActiveDocument.Close()

    word.Quit()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top