Consulting

Results 1 to 2 of 2

Thread: Moving typewriter text box up screen

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Moving typewriter text box up screen

    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
    Last edited by Aussiebear; 08-13-2022 at 02:11 PM. Reason: Added code tags to submitted code

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •