WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Word

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Extract Image from Word document


Question:

Has anyone been able to extract a picture from a word document? I've looked through examples and stuff. Thanks.

Answer:

Just a guess...Use Ole to Save the document as a Web page. Graphics and will be saved out as separate files...
file = "c:\temp\picture.doc"
newfile = "c:\temp\picture.html"
App = ObjectOpen("Word.Application")
Docs = App.Documents
Doc = Docs.Open(file)
wdFormatFilteredHTML = 10
Doc.SaveAs(newfile,wdFormatFilteredHTML)
Doc.Close()
App.Quit()

picdir =  StrCat("C:\temp\",FileRoot(newfile),"_files\" )
file = AskFilename( "Files", picdir, "All Files|*.*", "", 1)
Run(file,"")

ObjectClose(Doc)
ObjectClose(Docs)
ObjectClose(App)

Article ID:   W17186
File Created: 2007:07:03:14:28:38
Last Updated: 2007:07:03:14:28:38