How to convert Word to images with win32com in python?
I have googled an example for converting Word to Html.
import win32com
from win32com.client import Dispatch, constants
w = win32com.client.Dispatch('Word.Application')
w = win32com.client.DispatchEx('Word.Application')
'''skip some code here'''
wc = win32com.client.constants
w.ActiveDocument.SaveAs( FileName = filenameout, FileFormat = wc.wdFormatHTML )
I tried looking for something like wc.wdFormatPNG
as wc.wdFormatHTML
in the example but failed.And I wonder does th开发者_JS百科e attribute exist?Or any other better solutions?Suggestions would be appreciated.
You can try to print the Word document to PDF or TIFF file. I never did it myself, but if it can be done manually, most probably you can automate it.
精彩评论