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


Figure 10.4. Pick-A-Partner VBA Code


Download 1.37 Mb.
Pdf ko'rish
bet183/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   179   180   181   182   183   184   185   186   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

Figure 10.4. Pick-A-Partner VBA Code


The
WorkTogether
procedure calls all the procedures needed to make ev -
erything hap pen. When I took my first computer course, the instructor told us to
think about what we wanted our pro gram to do and write a top-level pro cedure to 
call other procedures to do it. Then, he sug gested that you have fi nished something
important and you should go have a beer. That is what the 
WorkTogether
pro -
cedure does. Go have a beer (if you are of le gal drinking age, not driv ing, not
pregnant, etc.)! This pro cedure does all of the fol lowing:
• It asks the user to in put a name, e-mail address, and pro ject idea
(
GetNameEmailIdea
).
• It jumps to the tenth slide thanking the user for wanting to work with
you (
GoToWorkTogether
).
• It cre ates a new slide that contains the name, e-mail, address, and
project idea (
AddWorkTogetherSlide
),
• It saves the presentation so the newly added slide be comes part of
the pre sen ta tion (
Save
),
The pro ce dures
YourIdea_are_all_variations_of_the_YourName'>YourName
,
YourEmail
, and 
YourIdea
are all variations
of the 
YourName
pro cedure from earlier chap ters. Al though any version of
YourName
will work, 
YourName
and 
YourEmail
use a ver sion that forces the
user to type something. Because giv ing a pro ject idea is op tional,
YourIdea
uses a version that does not re quire the user to type any thing. The name, e-mail
address, and project idea are stored in the variables
userName
,
userEmail
, and 
userIdea
re spectively. At the appropriate time, all three of these procedures
are called in succession by the

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   179   180   181   182   183   184   185   186   ...   191




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