M
morag
I don't know much about vba, Iv'e been trying to figure out how to do stuff
through using other people's code.
so, this is what i'd like to do:
I'm creating a powerpoint learning game which teaches hebrew. there is a
slide for each letter. each slide has 4 correct answers and 4 wrong answers.
all along the presentation there are correct score and wrong score shapes
with their value visible. (I added them in the slide master). after 4 correct
answers were clicked, the presentation advances to the next slide.
my problems:
1. when I run the slide show the score value does not begin with 0 (although
macro begin was activated)
2. it does not advance to the next slide.
I would really appreciate if anybody can look at my code and tell me what
i'm doing wrong. Thanks in advance!
Const ls = 3 (ls stands for last slide)
Dim current_correct As Integer (current_correct counts how many correct
clicks were made on current slide in order to advance after 4)
Dim correctbox As Shape (this shows number of correct clicks all along
presentation)
Dim incorrectbox As Shape ((this shows number of correct clicks all along
presentation)
Dim sn As Integer
Sub Begin()
ActivePresentation.SlideMaster.Shapes("correctbox").TextFrame.TextRange.Text
= 0
ActivePresentation.SlideMaster.Shapes("incorrectbox").TextFrame.TextRange.Text = 0
current_correct = 0
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Rightanswer()
ActivePresentation.SlideMaster.Shapes("correctbox").TextFrame.TextRange.Text
=
ActivePresentation.SlideMaster.Shapes("correctbox").TextFrame.TextRange.Text
+ 1
check_done
End Sub
Sub check_done()
current_correct = current_correct + 1
If current_correct = 4 Then
current_correct = 0
advance
End If
End Sub
Sub Wronganswer()
activePresentation.SlideMaster.Shapes("incorrectbox").TextFrame.TextRange.Text
=
ActivePresentation.SlideMaster.Shapes("incorrectbox").TextFrame.TextRange.Text + 1
End Sub
Sub advance()
sn = SlideShowWindow.View.Slide.SlideIndex
If sn <> ls Then
ActivePresentation.SlideShowWindow.View.Next
End If
End Sub
through using other people's code.
so, this is what i'd like to do:
I'm creating a powerpoint learning game which teaches hebrew. there is a
slide for each letter. each slide has 4 correct answers and 4 wrong answers.
all along the presentation there are correct score and wrong score shapes
with their value visible. (I added them in the slide master). after 4 correct
answers were clicked, the presentation advances to the next slide.
my problems:
1. when I run the slide show the score value does not begin with 0 (although
macro begin was activated)
2. it does not advance to the next slide.
I would really appreciate if anybody can look at my code and tell me what
i'm doing wrong. Thanks in advance!
Const ls = 3 (ls stands for last slide)
Dim current_correct As Integer (current_correct counts how many correct
clicks were made on current slide in order to advance after 4)
Dim correctbox As Shape (this shows number of correct clicks all along
presentation)
Dim incorrectbox As Shape ((this shows number of correct clicks all along
presentation)
Dim sn As Integer
Sub Begin()
ActivePresentation.SlideMaster.Shapes("correctbox").TextFrame.TextRange.Text
= 0
ActivePresentation.SlideMaster.Shapes("incorrectbox").TextFrame.TextRange.Text = 0
current_correct = 0
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Rightanswer()
ActivePresentation.SlideMaster.Shapes("correctbox").TextFrame.TextRange.Text
=
ActivePresentation.SlideMaster.Shapes("correctbox").TextFrame.TextRange.Text
+ 1
check_done
End Sub
Sub check_done()
current_correct = current_correct + 1
If current_correct = 4 Then
current_correct = 0
advance
End If
End Sub
Sub Wronganswer()
activePresentation.SlideMaster.Shapes("incorrectbox").TextFrame.TextRange.Text
=
ActivePresentation.SlideMaster.Shapes("incorrectbox").TextFrame.TextRange.Text + 1
End Sub
Sub advance()
sn = SlideShowWindow.View.Slide.SlideIndex
If sn <> ls Then
ActivePresentation.SlideShowWindow.View.Next
End If
End Sub