trying to add animation using code in a presentation

M

misscrf

I have a presentation that has some slides where users are asked
questions. For this example I am working on, I have a list box, which
is filled with values (test1, test2, test3, test4)

based on what the user selects, a text box tells them if they are right
or not. I am trying to make this text box animate. I am having a heck
of a time with this! Can anyone please help?

Here is the code that I have, which triggers on click of the listbox,
but it doesn't like adding the textbox, as it stops at the shape...

Code:
Private Sub ListBox1_Click()
Dim oEffect As Effect
Dim oShpA As Shape

If ListBox1 <> "" Then
answer = ListBox1
If answer = "Test1" Then
With ActivePresentation.Slides(1)
Set oShpA =
..Shapes.AddTextbox(Type:=msoTextOrientationHorizontal, _
Left:=100, Top:=100, Width:=200, Height:=50).TextFrame _
.TextRange.Text = "That's part right, but there's more!"
Set oEffect = .TimeLine.InteractiveSequences.Add _
.AddEffect(Shape:=oShpA,
effectId:=msoAnimEffectPathCircle)
End With
ElseIf answer = "Test2" Then
With ActivePresentation.Slides(1)
'Create two autoshapes on the slide.
Set oShpA =
..Shapes.AddTextbox(Type:=msoTextOrientationHorizontal, _
Left:=100, Top:=100, Width:=200, Height:=50).TextFrame _
.TextRange.Text = "That's kinda sorta right, but there's some
more!"
Set oEffect = .TimeLine.InteractiveSequences.Add _
.AddEffect(Shape:=oShpA,
effectId:=msoAnimEffectPathCircle)
End With

ElseIf answer = "Test3" Then
With ActivePresentation.Slides(1)
Set oShpA =
..Shapes.AddTextbox(Type:=msoTextOrientationHorizontal, _
Left:=100, Top:=100, Width:=200, Height:=50).TextFrame _
.TextRange.Text = "There's more, but that is part of it!"
Set oEffect = .TimeLine.InteractiveSequences.Add _
.AddEffect(Shape:=oShpA,
effectId:=msoAnimEffectPathCircle)
End With
ElseIf answer = "Test4" Then
With ActivePresentation.Slides(1)
' Set oShpA =
..Shapes.AddTextbox(Type:=msoTextOrientationHorizontal, _
Left:=100, Top:=100, Width:=200, Height:=50).TextFrame _
.TextRange.Text = "WOHOOOOOO!!!!! You Got it Right!"
Set oEffect = .TimeLine.InteractiveSequences.Add _
.AddEffect(Shape:=oShpA,
effectId:=msoAnimEffectPathCircle)
End With
End If
End If
End Sub
----------------------------------------------------

It highlights : (Type:=msoTextOrientationHorizontal, and doesn't like
it. What am I doing wrong? Is there a better way to do this?

Thanks!
 

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

Similar Threads


Top