Hello
I'm trying to use Powerpoint VBA to get a text box to move smoothly up a screen. The box has an entry animation with the text set to appear by letter (to create a typewriter effect). I then want to click on a command buttom to make the box move smoothly up the screen. The code which does this is below : the text box is called 'TxtPrint'.
The problem is that when I click the button the text box just disappears. I have tried the same code with other types of shape and it works as intended, so there is a problem with how I am applying it to text boxes.
I am aware that it is straightforward to do this using animations in 'core' powerpoint. However I want to understand the basics of doing it in VBA so I can apply it to more complex problems. Grateful for any advice which people can offer.
Thanks
Chris
Private Sub Button_Click()
Dim objSequence As Sequence
Dim objTxt1 As Shape
Dim objEffect1 As Effect
Dim sld As Slide
Set sld = ActivePresentation.Slides(3)
Set objTxt1 = sld.Shapes("TxtPrint")
Set objSequence = sld.TimeLine.MainSequence
Set objEffect1 = objSequence.AddEffect(Shape:=objTxt1, EffectID:=msoAnimEffectFloat, trigger:=msoAnimTriggerOnClick)
objEffect1.EffectType = msoAnimEffectPathUp
'objEffect1.Exit = msoTrue
End Sub