Geoff,
FromX, FromY, ToX, ToY are distinct from the Path property. Use either the
Path property to assign the motion path using VML string or make using of
FromX, FromY,ByX,ByY and ToX and ToY properties.
Shyam,
You may remember that I have been trying to deal with words which move
across the slide from one column to another and changing them from On
Click to Click on shape so that I can then use the kiosk mode.
The code below seems to work OK, but it may well lack elegance (!) and
perhaps you could explain this better way to get the FromX etc values?
Thanks
Geoff
effectId:=msoAnimEffectPathCurvyStar, _
Sub check_for_button(strMyFile As String)
Dim oPresentation As Presentation
Set oPresentation = Presentations.Open(strMyFile)
Dim oSl As Slide
Dim y As Long
Dim i As Long
Dim oSh As Shape
Dim oEffect As Effect
Dim oShB As Shape
Dim pathdata(20)
Dim aniMotion As AnimationBehavior
With oPresentation
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
Set shpAnswer = oSl.Shapes.AddShape(msoShapeRectangle, _
600, 50, 100, 50)
shpAnswer.TextFrame.TextRange.Text = "Answer"
GoTo Nextsub
End If
Next
End With
Nextsub: With oSl.TimeLine
y = 1
For i = .MainSequence.count To 1 Step -1
If .MainSequence(i).Shape.Type = msoTextBox Then
Set oSh = .MainSequence(i).Shape
pathdata(y) = .MainSequence(i).Behaviors(1).MotionEffect.path
Set oEffect = _
oSl.TimeLine.InteractiveSequences.Add.AddEffect(Shape:=oSh, _
effectId:=msoAnimEffectCustom, _ Trigger:=msoAnimTriggerOnShapeClick)
With oEffect.Timing
..Duration = 2
..TriggerDelayTime = 0
End With
Set aniMotion = oEffect.Behaviors.Add(msoAnimTypeMotion)
With aniMotion.MotionEffect
.fromx = Split(pathdata(y))(1)
.FromY = Split(pathdata(y))(2)
.ToX = Split(pathdata(y))(4)
.ToY = Split(pathdata(y))(5)
End With
oEffect.Timing.TriggerShape = shpAnswer
End If
y = y + 1
Next i
End With
Next oSl
oPresentation.Save
oPresentation.Close
End With
Set oSh = Nothing
Set oPresentation = Nothing
End Sub