Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to programmatically embed photos in Word?

Status
Not open for further replies.

pattyc

Programmer
Aug 15, 2006
16
US
My app creates an HTML with text and images. Then I use a converter (currently trying out ConvertDoc) to convert the HTML to a Word doc. I'm doing this because I need to have the images inline with the text so that a user would be able to open the Word doc and select, copy and paste a whole line (with text and images) all at once.

The problem is that the resulting Word doc has, I guess, links to the images. The images are not actually embedded (or inserted) into the Doc. Is there a an HTML->Word converter that will insert the images, or is there a way to this programmatically?

I'm using Word 2007, but the end users might be using any version of Word.

I've read that if you open a Word 2003 doc with images and then Ctrl-A, Ctrl_Shift-F9 and then save the doc, the images will be inserted into the doc. However, I've also read that this doesn't work with Word 2007. Plus I don't know if this can be done programmatically.

Thanks - any help or advice is appreciated.
 
Hi Pattyc,

The Ctrl-A then Ctrl-Shift-F9 approach should work in Word 2007. Have you tried it?

The vba equivalent would be:
ActiveDocument.Fields.Unlink

Cheers

[MS MVP - Word]
 
I use an inexpensive package called SnagIt 8 and it works great.

Regards
Peter Buitenhek
ProfitDeveloper.com
 
Hi Peter,

That doesn't directly address Pattyc's problem, which is that the pics are already in the document, but as linked images rather than as embedded images.

Cheers

[MS MVP - Word]
 
Thanks for your replies! I couldn't get the Ctrl-A, Ctrl-Shift-F9 approach working with Word 2007 (I could with Word 2003).

So I found a Word->RTF converter which inserts the images into the resulting Word doc. I just need to clean up my HTML, and I think I'll be ok then.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top