12-28-2012, 06:59 AM
|
Competent Performer
|
|
Join Date: Mar 2012
Posts: 240
|
|
Quote:
Originally Posted by tinfanide
I don't know if .expression is the correct term.
I wonder if I can do this:
No error if I put .Shapes.Title in the animations Sub but
error if I pass it as a parameter.
Can it be done?
Code:
Sub test()
'' can't pass .Shapes.Title as a parameter
Call animations(3, .Shapes.Title, msoAnimEffectAppear, msoAnimateTextByAllLevels, msoAnimTriggerOnPageClick, -1, 5, 1, ppAfterEffectHideOnClick)
End Sub
Sub animations(vIndex As Variant, oShape As Shape, oEffectId As MsoAnimEffect, oLevel As MsoAnimateByLevel, oTrigger As MsoAnimTriggerType, lIndex As Long, lDuration As Long, lTriggerDelayTime As Long, oAfterEffect As PpAfterEffect)
With ActivePresentation.Slides(vIndex)
With .TimeLine.MainSequence.AddEffect( _
'' oShape = .Shapes.Title
Shape:=oShape, _
effectId:=oEffectId, _
Level:=oLevel, _
trigger:=oTrigger, _
Index:=lIndex)
With .Timing
.Duration = lDuration
.TriggerDelayTime = lTriggerDelayTime
End With
.Shape.AnimationSettings.AfterEffect = oAfterEffect
End With
End With
End Sub
Thank you.
|
You are not referencing the full object in your 'Test' sub. You cannot use '.shapes...' since you haven't included the part which references 'ActivePresentation.Slides(vIndex)'.
Try this:
Code:
Call animations(3, ActivePresentation.Slides(3).Shapes.Title, msoAnimEffectAppear, msoAnimateTextByAllLevels, msoAnimTriggerOnPageClick, -1, 5, 1, ppAfterEffectHideOnClick)
|