extract images as jpg

M

matt

this is for stephen l. or anyone who's interested.
awhile back, i was checking out the possibility of
extracting embedded images in a word document as graphics
files. stephen wrote some great script to extract high-
res uncompressed bitmaps, which was awesome.
http://www.lebans.com/msword.htm

i wondered about the possibility of extracting a jpg, to
have some more control over the quality and compression
as it was pulled from the word file. not sure if anyone's
had a chnance to play with that.

i appreciate it!
matt
 
S

Stephen Lebans

I'm still at least another week or two away from modifying the existing
code to allow for programmatic saving of the Image to Jpg, TIff, PNG,
etc. via the GDI++ runtime.
If your need is urgent, there is existing code on my site that uses the
Intell JPEG DLL to allow you to save a DIBSection to a disk based JPEG
file. You could easily incorporate this code into my Word project.
http://www.lebans.com/loadsavejpeg.htm


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
J

John Leeke

Stephen:

I downloaded the two files (in word.zip) from your Lebans website, and
opened them in Word 2000, and looked at the macros. But, I could not figure
out how to get the macros to do their work of extracting the graphic files
in high res.

What do I do with the two files to extract graphics?

Thanks for your help.

John
 
D

Doug Robbins - Word MVP

See the article "What do I do with macros sent to me by other newsgroup
readers to help me out?" at:

http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
J

John Leeke

OK, I followed the directions at CreatAMacro.htm, but still could not get
Lebans's macro to work. Let me give a more specific problem description:

I open Lebans's ExtractImagever17.doc in MSWord 2000. I go
Tools>Macro>Macros> and select the SaveToBitmap macro, then click on <Run>.
Then I get the following error from Microsoft Visula Basic: "The macros in
this project are disabled. Please refer to the online help or documentation
of the host
application to determine how to enable macros."

I cannot find anything in the Word Help that says how to enable macros. I do
have other macros in my normal.dot that are working.

What can I do to enable the Lebans macro and get it to work?

Thank you for your help.

John
 
G

Graham Mayor

You need to change the macro security level from High to Medium. You can set
this from the tools > macro > security dialog.
Then when you open a document which contains macros, you will get a warning
prompt requiring your authorisation to allow the macros. While in that
dialog set Word to trust all installed templates and add-ins.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>><
 
J

John Leeke

OK, now I've gotten the SaveToBitmap macro to work--very good.

Now, how do I get the macro over to my own normal.dot?

I've tried using the macro organizer. Three items appear on the left side of
the organizer, apparently from the ExtractImagever17.doc file. None of the
items are named SaveToBitmap. If I copy the three items over to my own
normal.dot, the SaveToBitmap macro does not appear in my normal.dot.

Please advise on how to copy the SaveToBitmap macro over to my normal.dot.

John
 
D

Doug Robbins - Word MVP

Open the ExtractImagever17.doc file, go to the Visual Basic Editor and
select the SaveToBitmap macro, (that is everything From Sub SaveToBitmap()
and the End Sub) and copy it to the Clipboard.

Then, back in Word, from the Tools menu, select Macro and then Macros and in
Macros in: pulldown, select the Normal.dot (global template). Now in the
macro name field type SaveToBitmap and then click on the Create button. The
Visual Basic Editor will appear with

Sub SaveToBitmap()

End Sub

Select these two items and then right click and paste the macro from the
clipboard.
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
J

John Leeke

OK, this helped, but I found I had to use the Macro Organizer to copy the
additional three macro components over to normal.dot in order to get the
macro to work.

Thanks to everyone for their help.

John Leeke
 

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