printableSlide.Shapes(2).TextFrame.TextRange.Text & _
"Ques
tion " & i & ": " & an
swer(i) & Chr$(13)
Next i
In English, this code says: For each an swer in the
an
swer
ar ray, take all the
text we have already put in
Shape2
of the slide (
printableSlide.
Shapes(2).TextFrame.TextRange.Text
) and add (
&
) to that the question
num ber (
"Ques
tion " & i
) and the an swer with a new line (
an
swer(i) &
Chr$(13)
). Af ter the
For
loop, we also add to all of that the score and the in -
structions for print ing the slide.
Finally, if you are us ing a version of PowerPoint that does not au tomati-
cally change the size of the text to fit the text box, you will want to be sure to
change the size of the text so you can fit more than three or four answers on the
slide:
printableSlide.Shapes(2).TextFrame.TextRange.Font.Size = 9
Just change the
9
to a smaller number if you have more questions.
As a scripter, your burn ing question should be: How do I add ques tions to
my presentation? If you have put all the above code in your presentation, you
must do the following things to add questions:
1.
For each multiple-choice ques tion, do not touch the VBA; just add the
question slide and tie the but
ton for the right answer to
RightAnswerButton
and the but
tons for wrong answers to
WrongAnswerButton
.
2.
For each short-answer question, add a slide with the ques tion and tie
the question but
ton to a new pro
cedure that is exactly like
Question3
, ex cept that it will have a dif ferent number for the name
of the procedure (
Do'stlaringiz bilan baham: |