Transform BMP to JPG with Macro

J

Juan

Hi all,
Thanks in advance for any help you can provide. Im having the following
problem:

The design department of our company (which has super cool, big, fast...etc
computers) thinks that sending 4-8 Mb emails to us simple mortals is nothing
to worry about but they easilly clog mu inbox with lots of needed information
but on an uncalled for resolution, and usually in the form of a ppt file. So
sometimes I go through the files and manually cut each picture which is a BMP
and paste special it as a JPG and usually after i'm done it goes from the
former 4-8Mb to a more friendly <1 Mb file and looks exactly the same. So i
was trying to do a VBA macro to do this automatically and got as far as going
thru every object in a slide, cheking wether it is a picture or not and if so
recording the original position from left and top and cutting it, the problem
is: HOW DO I SPECIAL PASTE IT AS A JPG IN THE ORIGINAL POSITION.

Please any help is greatly appreciated...

Cheers,
Juan
 
J

John Wilson

This is "Top of head / Air code" but I think it will do it.

Sub paster()
Dim osld As Slide
Dim oshp As Shape
Dim opaste As Object
Dim sngLeft As Single
Dim sngTop As Single
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.Type = msoPicture Then
sngTop = oshp.Top
sngLeft = oshp.Left
oshp.Cut
Set opaste = osld.Shapes.PasteSpecial(ppPasteJPG)
opaste.Left = sngLeft
opaste.Top = sngTop
End If
Next oshp
Next osld
End Sub
 
J

Juan

My system doesn't recognizes PasteSpecial, is this a version issue? I'm using
Win 2K and PP 2K,

Cheers
Juan
 
D

David M. Marcovitz

Yes, PasteSpecial is not supported in VBA in PPT 2000. It was introduced
in 2002 or 2003.
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
J

Juan

Any other suggestion on how to solve my problem besides updating my * system?
is there an add-in or reference that would enable me to paste special or
change the format on all pictures in a presentation?

Thanks for all your responses...
 

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