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


Download 1.37 Mb.
Pdf ko'rish
bet104/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   100   101   102   103   104   105   106   107   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

answer1
,
answer2
, and 
answer3
is fairly 
simple. Inserting a new page for printing and printing it is more com plicated. Be-
cause we are go ing to add a slide, we need to know which slide num ber to add.
This is done with the vari able
printablePageNum
. In our 
Ini 
tial 
ize
pro ce-
dure, we set this vari able to one more than the to tal number of slides that we have
(i.e., if we have six slides, this will be set to 7 be cause the slide we are go ing to
add will be the seventh slide):
printableSlideNum = ActivePresentation.Slides.Count + 1
The
PrintablePage
pro cedure creates the page. Fig ure 7.4 shows an ex ample
of this slide.
The fol 
lowing line cre 
ates a slide and stores it in the vari 
able
printableSlide
:
Set printableSlide = _
ActivePresentation.Slides.Add(In 
dex:=printableSlideNum, _
Lay 
out:=ppLayoutText)
106 Quizzes and Tests


Figure 7.4. Ex ample of Printable Slide
In 
dex:=printableSlideNum
cre ates a new slide af ter the last slide.
Lay 
out:=ppLayoutText
makes the slide a nor mal Bulleted List slide with
two text ar eas: (1) a ti tle area and (2) a bulleted list area. The fol lowing lines set
the text in those areas (this is where you would add the answers for more ques -
tions):
printableSlide.Shapes(1).TextFrame.TextRange.Text = _
"Re 
sults for " & userName
printableSlide.Shapes(2).TextFrame.TextRange.Text = _
"Your An 
swers" & Chr$(13) & _
"Ques 
tion 1: " & answer1 & Chr$(13) & _

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   100   101   102   103   104   105   106   107   ...   191




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