Extracting pictures from Word

R

rogsonl

I need to extract pictures embedded in word (both floating and inline) and
place them into a database. I need to do this in vb.

I have done the opposite, taking a figure from access and inserting it into
word. There I moved the picture to the clipboard by using an Access form and
a frame. Then I moved the picture into the clipboard, and pasted it into a
selected range.

Any ideas as to how to do the opposite?
 
O

Ole Nielsby

rogsonl said:
I need to extract pictures embedded in word (both floating and inline) and
place them into a database. I need to do this in vb.

I have done the opposite, taking a figure from access and inserting it
into
word. There I moved the picture to the clipboard by using an Access form
and
a frame. Then I moved the picture into the clipboard, and pasted it into a
selected range.

Any ideas as to how to do the opposite?

I don't know if this applies to Word but I wrote a VB6 addin that
extracts pictures from VB6 projects by walking the object tree,
getting picture handles (and palette handles when applicable).
I then use GDI+ functions to convert the appropriate GDI+ objects,
and serialize them to memory based IStream objects from which I
can then extract the data.

This only works for DLL add-ins - inter-process marshalling
invalidates the handles (the automation interface simply treats
them as longs).

Some relevant apis are:

GdiplusStartup
GdipGetImageEncoders
GdipGetImageEncodersSize
GdipCreateBitmapFromHBITMAP

(me thinks there are similar methods for metafiles)
CreateStreamOnHGlobal
GdipSaveImageToStream
GdiplusShutdown

HTH/Ole Nielsby/remove the slow slimy animal from my reply address
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top