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
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to