homeButton.TextFrame.TextRange.Text = "Start Again"
Then we make the but ton clickable and assign a pro cedure (in this case, the
StartAgain
pro cedure) to the but ton:
homeButton.ActionSettings(ppMouseClick).Action = ppActionRunMacro
homeButton.ActionSettings(ppMouseClick).Run = "StartAgain"
The code for the Print Results but ton is almost iden tical, so if you un der-
stood the code above you don’t need any explanation for the Print Results button.
Finally, we want to go to the slide (
ActivePresentation.SlideShowWindow.
View.Next
) that we just created and fool PowerPoint into think ing that the
presentation does not need to be saved (
ActivePresentation.Saved = True
—
see “Saving and Quitting” in Chap ter 8 for more in formation about this line).
The
PrintResults
pro cedure has two lines:
ActivePresentation.PrintOptions.OutputType = ppPrintOutputSlides
ActivePresentation.PrintOut From:=printableSlideNum, _
To:=printableSlideNum
The first line makes sure that PowerPoint knows it is go ing to print one slide per
page. The second line actually prints the single slide that we just created. If our
printable slide is slide number 6 (and thus
printableSlideNum
is 6), that line
says to print from slide 6 to 6.
The last pro cedure is
StartAgain
. This sim ply goes to the first slide, de -
letes the slide that was just printed (
ActivePresentation.Slides
(printableSlideNum).De
lete
), and makes sure that PowerPoint doesn’t
ask you to save.
You might want to know what but tons will be tied to the last three proce-
dures.
PrintablePage_,_in_stead_of_the_Feed_back'>PrintablePage
, in stead of the
Feed
back
procedure from ear lier exam-
ples, will be tied to the “How Did I Do” but ton. But what about the last two
procedures? That is a trick ques tion. You don’t tie them to any but tons. We have
used VBA to create the but tons and tie them to pro cedures as part of the
PrintablePage
pro cedure. Creation of the but tons and ty ing them to pro ce-
dures is taken care of automatically with our VBA.
108 Quizzes and Tests
Do'stlaringiz bilan baham: |