Formatting pictures on more than one slide at once

N

Nikki

Hi,

I have over 100 slides that I have 4 pictures on each. I need to format
each picture to the same size and then each picture to 1 of 4 postitions (i.e
top left picture on every slide needs to be in the same position on every
slide)

Is there a way to do this in bulk? I seem to have to do each slide one at a
time and that will take forever!

Thanks
 
B

buck_brown

Hi,

I have over 100 slides that I have 4 pictures on each. I need to format
each picture to the same size and then each picture to 1 of 4 postitions (i.e
top left picture on every slide needs to be in the same position on every
slide)

Is there a way to do this in bulk? I seem to have to do each slide one at a
time and that will take forever!

Thanks

Are the pictures the same? If so you could resize and position them
on the Master.
 
J

Jim Gordon MVP

Hi Nikki,

You would need a little bit of Visual Basic code (a macro) to automate this
task.

Rather than build a full-fledged application you could make a small piece of
code resize and position whatever you have selected.

It's not hard, but it involves learning some new stuff. Are you interested
in doing this?

-Jim Gordon
Mac MVP


Hi,

I have over 100 slides that I have 4 pictures on each. I need to format
each picture to the same size and then each picture to 1 of 4 postitions (i.e
top left picture on every slide needs to be in the same position on every
slide)

Is there a way to do this in bulk? I seem to have to do each slide one at a
time and that will take forever!

Thanks

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
N

Nikki

Thank you for your reply. Yes I am interested in learning new stuff to help
out. The main problem I am having is not being able to select all the
objects on all the slides at one time. It will let me select the 4 images on
the same slide but the moment I go to the next slide it unselects the images
I have already selected. Will VBA get around this?

The other problem I have is that this is due on Monday (Tuesday at the
latest )so I will need to learn fast
 
J

Jim Gordon MVP

Hi Nikki,

If this were thousands of slides I would recommend a more robust solution,
but for this quantity I'm going to suggest something less complex.

Let's sort this task into two actions. One action is to resize a picture.
The other action is to position the picture on the slide.

We could get fancy and loop through each slide and automatically resize each
one, but I think for this particular case let's try to keep it simple even
if it involves more clicking on your part.

PowerPoint has a visual basic editor, which is like a word processor for
computer code. The sheet of paper that you type on is called a module. Each
set of instructions is called a subroutine, or SUB().

First, let's make the editor easy to get at. From PowerPoint's VIEW menu
choose Toolbars > Visual basic. OK, so it's a tiny little 2 button toolbar,
but the editor button is on it, so click the visual basic editor button.

You'll now be viewing a screen that has 2 windows. Ignore those for now. We
need a place to put our code. From the Insert menu choose Module. Now
there's an empty window we can type in.

When you're in the visual basic editor you have access to visual basic help
(assuming you didn't do a custom install and leave it out when you installed
Office). Click the help button on the toolbar and search for this topic:
Working with shapes

Read the topic. Let's put the information in that help topic to work.

First let's use vba to adjust the size of the picture.

There is a thread of newsgroup postings that addresses this problem and it
has sample code that you can paste into the module window we opened.

Here is a link to the thread (long URL):
http://groups.google.com/group/microsoft.public.powerpoint/browse_frm/thread
/249d817a3da130fc/ace37c219f6a469b?lnk=st&q=powerpoint+resize+picture+vba&rn
um=2&hl=en#ace37c219f6a469b

In that thread MVP Brian Reilly offers this code snippet:

Sub scaleShape()
Dim dblscaleamount As Double
dblscaleamount = InputBox("Input in numbers like 1.5 for 150%, or .5_
for 50%?", "Scale Picture Dialog")
With ActiveWindow.Selection.ShapeRange
..Width = .Width * dblscaleamount
..Height = .Height * dblscaleamount
End With
End Sub

You can copy the above code text and paste it right into the module pane. If
any of it turns red, then click to the left of the first red word on a line
then press the delete key (might need to press more than once) to get rid of
any extra characters that can be introduced when copying from the web.

Ok now let's go back to regular PowerPoint by clicking the far left button
on the visual basic editor toolbar (it says View Microsoft PowerPoint if you
hold the cursor over it without clicking it). Select a picture on the slide.
Then click the Run Macro button on the Visual Basic Toolbar (the little 2
button toolbar we turned on earlier). You have one macro from wish to choose
and it will already be selected, so click the Run button. You'll see an
input box with a prompt asking you how much or little you wish to scale the
selected picture. Enter something like .5 to shrink the picture by 50% or
1.3 to make the picture 30% bigger.

It works, right? Now you have everything you need to resize any picture.
This is good because all your pictures will keep their original scale (ratio
of height to width).

In a different newsgroup thread MVP Shyam Pillal helped someone else
position a picture on a slide:
http://groups.google.com/group/microsoft.public.powerpoint/browse_frm/thread
/5261a022b9aa2a22/5e07d8dcd54e80ab?lnk=st&q=powerpoint+position+picture+vba&
rnum=2&hl=en#5e07d8dcd54e80ab

I'm modifying Shyam's code a little bit to make it simpler:

Sub UpperLeft()
With ActiveWindow.Selection.ShapeRange
..Left = 35
..Top = 100
End With
End Sub

Copy and paste the code above and paste it into the same module window as
the other code.

Go back to PowerPoint, select a picture and then click the Run Macro button.
Now you have 2 macros from which to choose. Select the UpperLeft macro and
click the Run button. You'll see the picture move to the location specified
by Left and Top numbers.

You can now make 3 additional macros, one for each of the 4 different
positions you need on a slide by simply copying the UpperLeft macro and
changing the numbers after the Left and Top property controls in the code
above. Rename the additional macros UpperRight(), LowerRight(), and
LowerLeft(). Macro names can't have any spaces or special characters and
must have open and close parentheses immediately after the name.

When you have these 5 macros you'll have everything you need to resize and
reposition each picture providing you select each one at a time and click
the Run Macro button to bring up each macro.

There's more you can do to automate this process, but for the number of
pictures you have I would stop here.

Nevertheless, the PowerPoint help topic I referred you to has code samples
for looping through slides if you want to get into things more. It is
possible to loop through and automatically set everything, but it is more
work and would take more time than I have at my disposal to tell you.

Additional examples are available on the web at Steve Rindsberg's web site:
http://www.steverindsberg.com/

Searching Google groups will also yield many vba code examples to help you
out.

When you open the saved presentation the next time you'll be asked what to
do about the macros. Click the Enable Macros button to get things working
again.

When you have more time you can explore vba more completely. I'm sure you
will find it fascinating.

-Jim Gordon
Mac MVP

Thank you for your reply. Yes I am interested in learning new stuff to help
out. The main problem I am having is not being able to select all the
objects on all the slides at one time. It will let me select the 4 images on
the same slide but the moment I go to the next slide it unselects the images
I have already selected. Will VBA get around this?

The other problem I have is that this is due on Monday (Tuesday at the
latest )so I will need to learn fast

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 

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