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


Download 1.37 Mb.
Pdf ko'rish
bet78/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   74   75   76   77   78   79   80   81   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

imal sign of Spring?")
If newstuff "" Then
With ActivePresentation.SlideShowWindow.View.Slide. _
Shapes(3).TextFrame.TextRange
.Text = .Text + Chr$(13) + newstuff
End With
End If
End Sub
This code works on a slide with two text boxes that you add as the second
and third shapes on the slide, and it works with a 2-Col umn Text slide. Just be-
ware that if you add text to an empty Placeholder (that’s one of those text boxes
that says “Click to add text” or “Click to add title” be fore you put any thing in it,
Ma nip u lat ing Text in Ob jects 81


i.e., your ti tle, left col umn, and right column in the 2-Col umn Text slide), your
text will not show up un til you exit the slideshow. To avoid this prob lem, ei ther
use a Ti tle Only slide and draw your own text boxes or type a space in the text
area so the Place holder is not empty.
The code works with the slide shown in Fig ure 6.6. This figure shows the
slide be fore and af ter typing some text. In this case, you would have pressed the
Plant but ton (which is tied to the 
AddPlant
pro cedure) twice and the An imal
button (which is tied to the 
AddAnimal
pro cedure) once, having been prompted
by an 
InputBox
each time to name a sign of spring. The
If
state ment in each
pro ce dure (along with the cor re spond ing 
End If
) can be left off, but it provides
you with an es cape if you accidentally hit the wrong but ton: Simply click OK
with out typ ing any thing. The
If
statement asks if you have typed something
(i.e., the text you typed is not the empty string), and it only adds the text to the
slide if the answer is yes.
Figure 6.6. Signs of Spring Dis cussion Slide—Before and Af ter
Of course the entire ex ample could be simplified with one procedure, one text
box, and one but ton if you don’t want to or ganize stu dent responses into two columns.
It can also be complicated by add ing more similar procedures, more text boxes, and
more but tons if you want to di vide student responses into more than two areas.

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   74   75   76   77   78   79   80   81   ...   191




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