Consulting

Results 1 to 8 of 8

Thread: Select all images on slide, center, animate

  1. #1
    VBAX Newbie
    Joined
    May 2012
    Posts
    5
    Location

    Select all images on slide, center, animate

    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.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Appear On click after previous?? What does that mean?

    Anyway this should get you started

    [vba]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[/vba]
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Newbie
    Joined
    May 2012
    Posts
    5
    Location
    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

  4. #4
    VBAX Newbie
    Joined
    May 2012
    Posts
    5
    Location
    John, this was the end result - a PPT addin:

    community.tableausoftware.com/thread/117389

  5. #5
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Thanks for the credit!

    You might want to check the XML in the latest ppam (The onAction string)
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  6. #6
    VBAX Newbie
    Joined
    May 2012
    Posts
    5
    Location
    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?

  7. #7
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    No I was saying I think there's a typo.

    onAction="animateiamges"
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  8. #8
    VBAX Newbie
    Joined
    May 2012
    Posts
    5
    Location
    How odd - it was working, but clearly not with that error - I must had introduced it at some point... Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •