Saving a shape (picture) in a gif format

G

Gustavo

I want to create a macro that will save an image on my
slide in a GIF format. The option to Save as Picture is
available in the shortcut menu only. When I record my
macro it creates a statement that saves the entire slide
as a GIF, not just the selected object.

(Eg.ActivePresentation.SaveAs FileName:="C:\Practice
Data\Picture1.gif", FileFormat:=ppSaveAsGIF,
EmbedTrueTypeFonts:=msoFalse)

Does anyone know how I can modify this to save the shape
only?
 
S

Shyam Pillai

Gustavo,
Use this code:

Call
ActiveWindow.Selection.ShapeRange(1).Export("C:\Workarea\filename.gif",ppSha
peFormatGIF)
 
S

Steve Rindsberg

Call
ActiveWindow.Selection.ShapeRange(1).Export("C:\Workarea\filename.gif",ppSha
peFormatGIF)

Watch the linebreaks, Gustavo. It should all be on one line.

And use:

Call ActiveWindow.Selection.ShapeRange.Export("C:\Workarea\filename.gif",ppShapeFormatGIF)

to export multiple selected shapes to a single file.

This works as far back as PPT 2000 - I don't recall whether PPT97 has an .Export method
 
S

Steve Rindsberg

I don't recall 2000 having an Export call too. Could you confirm, Steve?

It's one of those oddball hidden methods in 2000. Intellisense doesn't show
it, it doesnt show up in the object browser unless Show Hidden is on, but it
seems to work ok.
 
S

Steve Rindsberg

Great. It's still hidden in 2002/2003 too. I'll check again. Thanks.

Oh, I'm sure it's available in 2K. Guess where I copy/pasted your code snippet
to have a play? <g>
 

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