Loop through all pictures in a presentation with VBA

J

Jesper Kaas

Using Powerpoint 2003.

I have a presentation with 196 slides, where most slides have a
picture inserted from a file.
All these pictures must be resized, and the origin changed to the same
values for all pictures.
A recorded macro does this for a single slide, so I could manually go
through all slides and run the macro.

How do you make a loop that goes through all pictures in a
presentation ?
I tried the following:

Dim Pict as Object
For each Pict in Activedocument.Shapes
{code to reformat picture}
Next Pict

but get error "Object required" on the second line.

I am familiar with Object model and VBA for Word and Excel, but never
tried VBA in Powerpoint before.
 

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