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


ActivePresentation.SlideShowWindow.View.Slide.Shapes(3)


Download 1.37 Mb.
Pdf ko'rish
bet73/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   69   70   71   72   73   74   75   76   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

ActivePresentation.SlideShowWindow.View.Slide.Shapes(3) _
.TextFrame.TextRange.Text = "Hello"
changes the text of the third shape of the cur rent slide to “Hello.”
Now, we can put this to gether with
YourName
and 
Ini 
tial 
ize
to put the
user’s name in the text box:
Dim userName
'Link this to the first but 
ton on the ti 
tle slide.
Sub GetStarted()
Ini 
tialize 'Hide the stars
YourName 'Ask for the name
ActivePresentation.SlideShowWindow.View.Next 'Go to the next slide
End Sub
'GetStarted calls this so no but 
tons link to this di 
rectly.
'This as 
sumes that slides 2 and 3 will have the 4th shape that
'you will want to show when the right an 
swer is cho 
sen.
Sub Ini 
tial 
ize()
ActivePresentation.Slides(2).Shapes(4).Vis 

ble = False
ActivePresentation.Slides(3).Shapes(4).Vis 

ble = False
End Sub
'GetStarted calls this to ask for a name.
Sub YourName()
Dim done As Boolean
done = False
While Not done
userName = InputBox(prompt:="Type your name", _
Ti 
tle:="Input Name")
If userName = "" Then
done = False
Else
done = True
End If
Wend
End Sub
'Link this to the but 
ton that con 
tains the right an 
swer on each slide.
'Be sure you have used your draw 
ing tools to cre 
ate the 4th shape
'on each slide.

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   69   70   71   72   73   74   75   76   ...   191




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