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


Download 1.37 Mb.
Pdf ko'rish
bet110/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   106   107   108   109   110   111   112   113   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

Ini 
tial 
ize
pro cedure, instead of hid ing ob jects, we can set the color of our
menu buttons to blue, for ex ample:
ActivePresentation.Slides(2).Shapes(2).Fill.ForeColor.RGB = vbBlue
ActivePresentation.Slides(2).Shapes(3).Fill.ForeColor.RGB = vbBlue
ActivePresentation.Slides(2).Shapes(4).Fill.ForeColor.RGB = vbBlue
Note that the shape num bers are 2, 3, and 4 because we are re ferring to the num -
bers of the buttons, not the numbers of the smiling sunshines. In our
ReturnFromMenuFromPart
pro cedures, we need to change the color of the
buttons to a dif ferent color, using lines like the following:
ActivePresentation.Slides(2).Shapes(2).Fill.ForeColor.RGB = vbMagenta
Now that your students know where they have been, in the next section, we
will add a few lines so they have to com plete the tu torial be fore taking the quiz.
112 Quizzes and Tests


Hide the Quiz But ton
With a but ton on the menu slide, your stu dents can choose to take the quiz
whenever they want. Sometimes this is appropriate; sometimes it is not. For those
times when you want your stu dents to complete the tu torial be fore taking the quiz,
we will combine variables (to keep track of what the stu dents have done) with hid -
ing and showing ob jects (see “Hiding and Showing PowerPoint Objects” in Chapter
6). We will hide the Quiz but ton on the menu slide un til all sections of our tu torial
have been visited. Use the code in Figure 7.7 (page 114) to do this. Lines and proce-
dures noted with the com ment
‘ADDED
have been added to the code from the pre vi-
ous ex am ple.
Note that this figure does not in clude the 
RightAnswer
,
WrongAnswer
,
DoingWell
, and 
DoingPoorly
pro cedures. Ei ther use the simple ones from
the previous ex ample (see Figure 7.6, page 111) or use more com plicated quiz-
zes from other examples in this chapter.
If you are add ing onto the pre vious ex ample, all you need to change is the
VBA; all the but tons are tied to the same pro cedures. If you are starting with a
new file, use Figure 7.5 (page 110) to guide you in creating the PowerPoint
slides and tying the buttons to procedures.
The variables

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   106   107   108   109   110   111   112   113   ...   191




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