Use of streams than path in `wc.Dispatch("Word.Application").Documents.Open(docx_path)

<[email protected]>
Newsgroups gmane.comp.python.windows
Message-ID <[email protected]>
To convert docx to html , one would do

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

doc = word.Documents.Open(docx_path)

doc.SaveAs(html_path, 8)

But here we require paths. I am using python-docx-template . I read a docx file, template it, then save to a StringIO(). But now I have to first save the doc as .docx, then open it and then create .html files, then deal with PermissionErrors. How can I use the StringIO() in place of paths. Something like this:

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

doc = word.Documents.Open(docx_string_io)

doc.SaveAs(html_stream, 8)

Sent from Mail for Windows 10

_______________________________________________
python-win32 mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-win32
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.