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


printableSlide.Shapes(2).TextFrame.TextRange.Text =


Download 1.37 Mb.
Pdf ko'rish
bet146/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   142   143   144   145   146   147   148   149   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

printableSlide.Shapes(2).TextFrame.TextRange.Text = _
printableSlide.Shapes(2).TextFrame.TextRange.Text & _
"You got " & numCorrect & " out of " & _
numCorrect + numIncorrect & "." & Chr$(13) & _
"Press the Print Re 
sults but 
ton to print your an 
swers."
printableSlide.Shapes(2).TextFrame.TextRange.Font.Size = 9
Set homeButton = _
ActivePresentation.Slides(printableSlideNum).Shapes _
.AddShape(msoShapeActionButtonCustom, 0, 0, 150, 50)
homeButton.TextFrame.TextRange.Text = "Start Again"
homeButton.ActionSettings(ppMouseClick).Ac 
tion = ppActionRunMacro
homeButton.ActionSettings(ppMouseClick).Run = "StartAgain"
Set printButton = _
ActivePresentation.Slides(printableSlideNum).Shapes _
.AddShape(msoShapeActionButtonCustom, 200, 0, 150, 50)
printButton.TextFrame.TextRange.Text = "Print Re 
sults"
printButton.ActionSettings(ppMouseClick).Ac 
tion = ppActionRunMacro
Which Button Did I Press? 141


printButton.ActionSettings(ppMouseClick).Run = "PrintResults"
ActivePresentation.SlideShowWindow.View.Next
ActivePresentation.Saved = True
End Sub
Other than using the 
an 
swer
ar ray, the main change to this pro cedure is that we
must loop through all the an swers so we can display them. We can not put a line
for each an swer, as we have done in the past, because we do not know how many
questions we will have. In stead, we use a
For
loop to cy cle through the an swers
and add them to the slide:
For i = 1 To numQuestions
printableSlide.Shapes(2).TextFrame.TextRange.Text = _

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   142   143   144   145   146   147   148   149   ...   191




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