From: Kevin Dufendach on
I'm using the following code do set the selected objects as "animate
with previous" (equivalent to going [slide show] --> [custom
animation] --> [add effect] --> [entrance] --> [appear] --> [with
previous]). However, whenever I run the
oShape.AnimationSettings.Animate = msoTrue line, any previously
animated objects' timings get reset to 0.5, so there's a delay. Am I
doing something wrong? Is there a better way to animate objects?

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SetSelectedToAnimateAfterPrev()

Dim oShape As Shape
Dim oAnimObject As Object

On Error GoTo OnError

'Set Selected = ActiveWindow.Selection ' uncomment this line for
debugging purposes

For Each oShape In ActiveWindow.Selection.ShapeRange
oShape.AnimationSettings.Animate = msoTrue
'After previous line, the previously animated shapes' timings
get reset to 0.5

oShape.AnimationSettings.AdvanceMode = ppAdvanceOnTime
oShape.AnimationSettings.AdvanceTime = 0

For Each oAnimObject In
ActiveWindow.Selection.SlideRange.TimeLine.MainSequence
If oAnimObject.Shape.Name = oShape.Name Then
oAnimObject.Timing.TriggerType =
msoAnimTriggerWithPrevious
oAnimObject.Timing.Duration = 0.001
End If
Next oAnimObject
Next oShape

OnError:

End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
From: John Wilson john AT technologytrish.co DOT on
Animation Settings is designed for use with ppt 2000 or earlier and the
timeline for later versions. You shouldn't mix them!
--
-------------------------------------------
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk


"Kevin Dufendach" wrote:

> I'm using the following code do set the selected objects as "animate
> with previous" (equivalent to going [slide show] --> [custom
> animation] --> [add effect] --> [entrance] --> [appear] --> [with
> previous]). However, whenever I run the
> oShape.AnimationSettings.Animate = msoTrue line, any previously
> animated objects' timings get reset to 0.5, so there's a delay. Am I
> doing something wrong? Is there a better way to animate objects?
>
> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> Sub SetSelectedToAnimateAfterPrev()
>
> Dim oShape As Shape
> Dim oAnimObject As Object
>
> On Error GoTo OnError
>
> 'Set Selected = ActiveWindow.Selection ' uncomment this line for
> debugging purposes
>
> For Each oShape In ActiveWindow.Selection.ShapeRange
> oShape.AnimationSettings.Animate = msoTrue
> 'After previous line, the previously animated shapes' timings
> get reset to 0.5
>
> oShape.AnimationSettings.AdvanceMode = ppAdvanceOnTime
> oShape.AnimationSettings.AdvanceTime = 0
>
> For Each oAnimObject In
> ActiveWindow.Selection.SlideRange.TimeLine.MainSequence
> If oAnimObject.Shape.Name = oShape.Name Then
> oAnimObject.Timing.TriggerType =
> msoAnimTriggerWithPrevious
> oAnimObject.Timing.Duration = 0.001
> End If
> Next oAnimObject
> Next oShape
>
> OnError:
>
> End Sub
> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
>
From: Kevin Dufendach on
Thanks for the tip, John. That makes a lot more sense now why I was
getting such strange results. Looking quickly at the "TimeLine
Property" in the help docs helped me solve my problem. My corrected
code (which is also quite a bit simpler) is below if anyone is
interested:

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SetSelectedToAppearAfterPrev()
Dim oShape As Shape

On Error GoTo OnError

For Each oShape In ActiveWindow.Selection.ShapeRange

ActiveWindow.Selection.SlideRange.TimeLine.MainSequence.AddEffect _
Shape:=oShape, EffectID:=msoAnimEffectAppear,
trigger:=msoAnimTriggerWithPrevious
Next oShape

OnError:

End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''