Extracting images to file from Word using VB automation 
Author Message
 Extracting images to file from Word using VB automation
Hi all

I need to automate the extraction of images embedded in word 2000
docs.

I (logically) want to do something like

  for each picture in the document
    save it to file_n.graphicextension
  end for each

I'm already using VB to automate the extraction of textual
information, and "all" I have left to do is the images.

I don't care what format they come out in, as long as I can automate
saving each to a file and the file be of some graphical type
(bmp/gif/jpg/whatever).

What's the latest and greatest answer to this please?

Many thanks in advance

Chris Sexton



Sun, 30 Jan 2005 20:09:23 GMT  
 Extracting images to file from Word using VB automation
Hi Chris,

When the document is saved as web page, a .jpg file is created for each
image in it and placed in a folder with the document name.

Please post any response to the newsgroups for the benefit of others who may
also be following the thread.

Hope this helps,
Doug Robbins - Word MVP

Quote:
> Hi all

> I need to automate the extraction of images embedded in word 2000
> docs.

> I (logically) want to do something like

>   for each picture in the document
>     save it to file_n.graphicextension
>   end for each

> I'm already using VB to automate the extraction of textual
> information, and "all" I have left to do is the images.

> I don't care what format they come out in, as long as I can automate
> saving each to a file and the file be of some graphical type
> (bmp/gif/jpg/whatever).

> What's the latest and greatest answer to this please?

> Many thanks in advance

> Chris Sexton



Mon, 31 Jan 2005 18:04:12 GMT  
 Extracting images to file from Word using VB automation
Chris,
  I run Word through VB6.
  How do I do this programatically?
  moWord.Documents(1).SaveAs(????)
There are no options for HTML format.
I could run the word command macro "FileSaveHTML", but i
dislike running macros from VB6.

Thanks,

Mike

Quote:
>-----Original Message-----
>Hi Chris,

>When the document is saved as web page, a .jpg file is
created for each
>image in it and placed in a folder with the document name.

>Please post any response to the newsgroups for the

benefit of others who may
Quote:
>also be following the thread.

>Hope this helps,
>Doug Robbins - Word MVP


>> Hi all

>> I need to automate the extraction of images embedded in
word 2000
>> docs.

>> I (logically) want to do something like

>>   for each picture in the document
>>     save it to file_n.graphicextension
>>   end for each

>> I'm already using VB to automate the extraction of
textual
>> information, and "all" I have left to do is the images.

>> I don't care what format they come out in, as long as I
can automate
>> saving each to a file and the file be of some graphical
type
>> (bmp/gif/jpg/whatever).

>> What's the latest and greatest answer to this please?

>> Many thanks in advance

>> Chris Sexton

>.



Tue, 01 Feb 2005 02:48:01 GMT  
 Extracting images to file from Word using VB automation
hi chris,

I wasted a lot of time on this as well before figuring out a possible
solution.

You can actually copy a word graphic/image to the clipboard using the copy
or copyAsPicture method of the range object, and then use the vb6 functions
for clipboard to get the data and put it into a picture object, which can be
saved.  Although it's a bit tricky, it's a relatively small amount of code .

You can also check the clipboardformat to find the format of the image.  One
caveat - it seems to only work for in-line shapes.  Luckily, you can convert
non in-line shapes into in-line.

Hope this helps,
Riz


Quote:
> Hi all

> I need to automate the extraction of images embedded in word 2000
> docs.

> I (logically) want to do something like

>   for each picture in the document
>     save it to file_n.graphicextension
>   end for each

> I'm already using VB to automate the extraction of textual
> information, and "all" I have left to do is the images.

> I don't care what format they come out in, as long as I can automate
> saving each to a file and the file be of some graphical type
> (bmp/gif/jpg/whatever).

> What's the latest and greatest answer to this please?

> Many thanks in advance

> Chris Sexton



Sun, 06 Feb 2005 00:17:14 GMT  
 Extracting images to file from Word using VB automation
Hi Mike

Use:

ActiveDocument.SaveAs FileName:=strDocName, _
        FileFormat:=wdFormatHTML

Please post any response to the newsgroups for the benefit of others who may
also be following the thread.

Hope this helps,
Doug Robbins - Word MVP

Quote:
> Chris,
>   I run Word through VB6.
>   How do I do this programatically?
>   moWord.Documents(1).SaveAs(????)
> There are no options for HTML format.
> I could run the word command macro "FileSaveHTML", but i
> dislike running macros from VB6.

> Thanks,

> Mike

> >-----Original Message-----
> >Hi Chris,

> >When the document is saved as web page, a .jpg file is
> created for each
> >image in it and placed in a folder with the document name.

> >Please post any response to the newsgroups for the
> benefit of others who may
> >also be following the thread.

> >Hope this helps,
> >Doug Robbins - Word MVP


> >> Hi all

> >> I need to automate the extraction of images embedded in
> word 2000
> >> docs.

> >> I (logically) want to do something like

> >>   for each picture in the document
> >>     save it to file_n.graphicextension
> >>   end for each

> >> I'm already using VB to automate the extraction of
> textual
> >> information, and "all" I have left to do is the images.

> >> I don't care what format they come out in, as long as I
> can automate
> >> saving each to a file and the file be of some graphical
> type
> >> (bmp/gif/jpg/whatever).

> >> What's the latest and greatest answer to this please?

> >> Many thanks in advance

> >> Chris Sexton

> >.



Sun, 06 Feb 2005 07:02:29 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. DAO Blob Adding/Extracting (audio files, text files, image files, program files)

2. Extract image from FRX to image file?

3. Extracting Word Doc Titles using VB....code examples

4. Help -- Background Print Word file using automation fails

5. Using VBA Automation to Open Word at the File Open Locatiion

6. VB Automation Using Word 7.0a for Win96

7. Extracting Word Images

8. Extracting images from Word

9. How to extract a file including folder using setup.lst from xxx.cab file

10. Need to extract files from a ZIP file programmatically using VBScript

11. Extracting Words Function using a Delimiter Character

12. extracting sql image field to file

 

 
Powered by phpBB® Forum Software