开发者

How to convert Word to images with win32com in python?

开发者 https://www.devze.com 2022-12-27 14:19 出处:网络
I have googled an example for converting Word to Html. import win32com from win32com.client import Dispatch, constants

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号