0

I am making html to doc converter

from win32com.client import Dispatch
wrd=Dispatch('Word.Application')
doc=wrd.Documents.Open(inputfile)
doc.SaveAs(outputfile, FileFormat=0)
doc.Close

And I wand save picture to document: Prepare->Edit links to file->Save picture to document

What command I need?

https://i.stack.imgur.com/SJOS7.png

1 Answer 1

1

I believe you are looking for the AddPicture method in the InlineShapes collection.

FileName

Required String. The path and file name of the picture.

LinkToFile

Optional Object. True to link the picture to the file from which it was created. False to make the picture an independent copy of the file. The default value is False.

**SaveWithDocument**

Optional Object. True to save the linked picture with the document. The default value is False.

Range

Optional Object. The location where the picture will be placed in the text. If the range isn't collapsed, the picture replaces the range; otherwise, the picture is inserted. If this argument is omitted, the picture is placed automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.