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


speed = InputBox ("How fast do you read [fast, me


Download 1.37 Mb.
Pdf ko'rish
bet127/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   123   124   125   126   127   128   129   130   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

speed = InputBox ("How fast do you read [fast, me 
dium, slow]?")
Now when it is time to wait, you might do something like the following:
If speed = "fast" Then
Wait (5)
ElseIf speed = "me 
dium" Then
Wait (10)
Else
Wait (15)
End If
You should note that wait times are approximate. This does not work well if you
need precise timing, but it should do roughly what you want.
Saving and Quit ting
When you use VBA to change your pre sentation in any way (including
adding shapes, hid ing shapes, chang ing text, etc.), PowerPoint recognizes that
your pro 
ject has been changed. When 
ever a pro 
ject has been changed,
PowerPoint wants to save it. If you don’t save it, and you exit PowerPoint,
PowerPoint will ask you if you want to save. This is a good thing if you are de -
signing a pro ject and forgot to save be fore exiting. This might not be such a good 
thing if one of your students is run ning your project.
As the de signer of an interactive multimedia pro ject, you should know
when you want to save and when you don’t. In “How Did You Do: Re porting
Results to the Teacher” in Chapter 7, we added a slide to re port the re sults, but
Saving and Quitting 127


we didn’t want to save the slide. In this case, PowerPoint knows that the presen-
tation has been changed, so we needed to make it think that it was not changed.
Of course, changes that PowerPoint thinks need to be saved do not have to be as
large as adding a slide. Changes as small as hid ing or showing an ob ject, such as
a shape that in dicates the student has vis ited part of the tu torial in “Learn First,
Ask Questions Later” in Chapter 7, will make PowerPoint think your presenta-
tion needs to be saved.
In other cases, we might want the changes to be saved. In Chapter 10 is an
example in which important slides are be ing added to the presentation. As us ers
go through the pro ject, they might be asked for in formation, which is stored on a
newly created slide. Later, the de signer will go through the pre sentation and look
at those slides . . . only if they were saved.
Fortunately, it is very easy to con trol whether or not your pre sentation is
saved. Four simple pro cedures will help you:

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   123   124   125   126   127   128   129   130   ...   191




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