PDA

View Full Version : Select all images on slide, center, animate



akerin
05-10-2012, 08:31 AM
Hopefully this should be straightforward - I seem to struggle constantly trying to get this right myself.

I want to select all the images on a slide, center each of them to the slide center (can be approximate - they should be the same size already and do not want to resize them).

Then animate them with "Appear" on click, after previous, and a 0.5s delay between each. The animation order and image order should not be an issue because they were brought in the correct order to the slide - at least that's how it works now manually.

Appreciated.

John Wilson
05-10-2012, 09:09 AM
Appear On click after previous?? What does that mean?

Anyway this should get you started

Sub dothis()
Dim osld As Slide
Dim oshp As Shape
Dim oeff As Effect
On Error Resume Next
Set osld = ActiveWindow.View.Slide
If Not osld Is Nothing Then
For Each oshp In osld.Shapes
If oshp.Type = msoPicture Then
oshp.Select Replace:=False
Set oeff = osld.TimeLine.MainSequence.AddEffect(oshp, msoAnimEffectAppear, , msoAnimTriggerAfterPrevious)
oeff.Timing.TriggerDelayTime = 0.5
End If
Next oshp
ActiveWindow.Selection.ShapeRange.Align (msoAlignCenters), RelativeTo:=True
ActiveWindow.Selection.ShapeRange.Align (msoAlignMiddles), RelativeTo:=True
End If
End Sub

akerin
05-10-2012, 10:07 AM
John, appreciated, I will try this out.

And of course, I meant: appear automatically after previous with 0.5 delay

EDIT: Which is what it looks like you assumed. And it works nicely, thanks again

akerin
05-10-2012, 11:07 AM
John, this was the end result - a PPT addin:

community.tableausoftware.com/thread/117389

John Wilson
05-10-2012, 01:53 PM
Thanks for the credit!

You might want to check the XML in the latest ppam (The onAction string)

akerin
05-10-2012, 02:36 PM
Hadn't noticed I'd also used your site in understanding how to create the XML. So if I follow, you can use the OnAction to create the ribbon additions without having to go through the XML process?

John Wilson
05-10-2012, 03:39 PM
No I was saying I think there's a typo.

onAction="animateiamges"

akerin
05-11-2012, 12:11 PM
How odd - it was working, but clearly not with that error - I must had introduced it at some point... Thanks