PPT TimeLine and error in code?

G

Geoff Cox

Hello,

I cannot see how to refer to the already exisiting shape when it comes
to the trigger line. Bellow I am using

set oSh = MainSequence(i) ******

and then oSh in the trigger line, but this is obviously wrong. How do
I refer to it?

Thanks

Geoff


For Each oSl In ActivePresentation.Slides

ActiveWindow.View.GotoSlide (oSl.SlideIndex)

With oSl.TimeLine
For i = .MainSequence.Count To 1 Step -1
If .MainSequence(i).Shape.Type = msoTextBox Then
If .MainSequence(i).Shape.AnimationSettings _
.EntryEffect = ppEffectDissolve Then
Set oShB = oSl.Shapes.AddShape(msoShapeRectangle,
_500, 200, 100, 50)
set oSh = MainSequence(i) ******
Set oEffect = .InteractiveSequences.Add _
.AddEffect(Shape:= oSh,_
effectId:=ppEffectDissolve, _
trigger:=msoAnimTriggerOnShapeClick)

oEffect.Timing.TriggerShape = oShB
End If
End If
Next i
End With
Next oSl
 
G

Geoff Cox

Hello,

I cannot see how to refer to the already exisiting shape when it comes
to the trigger line.

Using

Set oSh = .MainSequence(i).Shape

and finding a typo solved the problem!

Code below works.

Cheers

Geoff


With oSl.TimeLine
For i = .MainSequence.Count To 1 Step -1
If .MainSequence(i).Shape.Type = msoTextBox Then
If .MainSequence(i).Shape.AnimationSettings.EntryEffect _
= ppEffectDissolve Then
Set oSh = .MainSequence(i).Shape
.MainSequence(i).Delete
Set oShB = oSl.Shapes.AddShape(msoShapeRectangle, 500, 200, _
100, 50)
Set oEffect = .InteractiveSequences.Add _
.AddEffect(Shape:=oSh, effectId:=msoAnimEffectDissolve, _
trigger:=msoAnimTriggerOnShapeClick)
oEffect.Timing.TriggerShape = oShB
End If
End If
Next i
End With
Next oSl
 

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