Powerful PowerPoint for Educators: Using Visual Basic for Applications to Make PowerPoint Interactive


ActivePresentation.Slides(2).Shapes(5).Vis


Download 1.37 Mb.
Pdf ko'rish
bet64/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   60   61   62   63   64   65   66   67   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

ActivePresentation.Slides(2).Shapes(5).Vis 

ble = False
Change
False
to 
True
, and you show the ob ject once again:
ActivePresentation.Slides(2).Shapes(5).Vis 

ble = True
For ex ample, you might want a star to ap pear on a slide when a user gets the
correct an swer. To do this, create the star where you want it (using reg ular
PowerPoint drawing tools). Even add text, such as “Good job!” See “Manipulat-
ing Text in Ob jects” be low for more about changing the text on the fly to in clude
the current score or the user’s name. Be fore this can work ef fectively, we’ll need
to set up the presentation be fore the user gets to the slide with the star. This will
re quire us to ini tial ize the pre sen ta tion.
68 A Scripting Bag of Tricks


Let’s Get Started: Initializing Your Presentation
Up to this point, the user could go to any slide and not worry how it looked
or even what was in any of the variables ex cept pos sibly
userName
. As our pre -
sentations get more complicated, we will need to keep track of many dif ferent
things. It will be important that everything in the pre sentation starts out how you
want it. You don’t want the user to go to a slide that has a star before choosing
the right an swer that is supposed to show the star. If you’re keep ing score, you
want to be sure that the score starts at 0.
These kinds of things should be set up at the be ginning of the pre sentation.
One of the best ways to do this is with a but ton on the ti tle slide. If it is the only
button on that slide and you are in Kiosk mode, you know the user has to click
that button to con tinue. All that the user might see is that the button goes to the
next slide or asks for a name, but be hind the scenes, your procedure is cleaning
up ev erything (making the beds, dusting the furniture, setting up variables, hid -
ing the toys and stars—all the things that you do before company comes).
In the hide and show ex ample from the pre vious section, the one thing we
want to do is hide our star. We will use a pro cedure called

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   60   61   62   63   64   65   66   67   ...   191




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling