views:

82

answers:

1

Hi all,

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 the attribute exist?Or any other better solutions?Suggestions would be appreciated.

A: 

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.

newtover
I've tried this but got errors when converting PDF to Images...
SpawnCxy