Pregunta

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'
¿Fue útil?

Solución

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()
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top