Animate TextBox Control with VBA, for quiz

M

misscrf

I have been working on some PowerPoint animation that works like a
quiz. A list box has possible answers, and depending on the answer
they choose, a textbox has a certain value and color to it. I would
also like to animate the text box so it looks slick. Here is the code
I have so far:

Private Sub ListBox1_Click()
If ListBox1 <> "" Then
answer = ListBox1

If answer = "My Answer 1" Then
txtExample = "That's part right, but there's more!"
txtExample.SpecialEffect = fmBorderStyleSingle
txtExample.ForeColor = RGB(128, 0, 255)
'Color - Purple
txtExample.BackColor = RGB(0, 255, 255)
'Color - Cyan
txtExample.BorderColor = RGB(0, 0, 0)
'Color - Black

ElseIf answer = "My Answer 2" Then
txtExample = "That's kinda sorta right, but there's some more!"
txtExample.SpecialEffect = fmBorderStyleSingle
txtExample.ForeColor = RGB(0, 191, 255)
'Color - Deep Sky Blue
txtExample.BackColor = RGB(173, 255, 47)
'Color - Green Yellow
txtExample.BorderColor = RGB(255, 20, 147)
'Color - Deep Pink

ElseIf answer = "My Answer 3" Then
txtExample = "There's more, but that is part of it!"
txtExample.SpecialEffect = fmBorderStyleSingle
txtExample.ForeColor = RGB(240, 128, 128)
'Color - Light Coral
txtExample.BackColor = RGB(216, 191, 216)
'Color - Thistle
txtExample.BorderColor = RGB(218, 165, 32)
'Color - Goldenrod

ElseIf answer = "My Correct Answer 4" Then
txtExample = "WOHOOOOOO!!!!! You Got it Right!"
txtExample.SpecialEffect = fmBorderStyleSingle
txtExample.ForeColor = RGB(208, 32, 144)
'Color - Violet Red
txtExample.BackColor = RGB(245, 245, 220)
'Color - Beige
txtExample.BorderColor = RGB(0, 250, 154)
'Color - Green
End If
End If
End Sub

All of this works, and now I jsut also want to add a line for each
answer like

docmd.animation = fly in left

or

txtExample.entrance = (flyin, Left)
lol
I know that's not right, but I am guessing someone out there might know
what would be right. Is there also a list of the vba names for the
animations for entrance and emphasis, etc?

Thanks!

misscrf

It is never too late to become what you could have been ~ George Eliot
 
A

Austin Myers

Go to the Microsoft web site and do a search for a file called
"vbapp10.chm". This is the documentation for the PowerPoint Object Model.
It should be a big help.


Austin Myers
MS PowerPoint MVP Team

Provider of PFCMedia, PFCPro, PFCExpress
http://www.pfcmedia.com
 
M

misscrf

Thank you for your responses. Steve, I did try the
txtExample.Animationsettings = pp....

That wasn't working either. I found it was easier to make a bunch of
text boxes. 4 set up to look like a list box. Then 4 more. each 1
acts on a trigger of 1 of the first 4. So if I click 1 a text box will
animate and enter telling me I am wrong, and then dissappear. If I
click 2, I get a different text box with same behavior, and so on.

Now, I just need to figure out how to reset the textboxes at the end of
the slideshow. Anyone know how to do this?

A bunch of them are named TextBox1, and I don't think it likes that.
If I run TextBox1.text = ""
on a slide where there is one, it clears that one.

If I try it at the end of the presentation to clear them all, it
doesn't work. :-(

Any thoughts?
 

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

Top