大约有 500 张幻灯片,第一张幻灯片是介绍,第二张幻灯片是关于 Start_time 宏的操作按钮的说明 - 一旦单击计时器就会启动。幻灯片 3 - 499 每个都有一个单词,因此读者必须在一段时间内浏览每张幻灯片,这就是 word_count 等于 slide.count 减三的原因。最后一张幻灯片将具有操作按钮,单击该按钮将显示阅读评估。
此宏用于我的 PowerPoint 演示文稿,旨在为我的学生提供阅读评估。
Dim Start_time As Date
_______________________________________________________________________________________
Sub Start_time()
'at action button click in the first slide the time starts counting
Start_time = Now()
End Sub
_______________________________________________________________________________________
Sub ReadingTime()
'at action button click on the last slide the evaluaton message appears
Dim Reading_Time As String
Dim End_Time As Date
Dim iTotal_time As Long
Dim Word_count As Integer
End_Time = Now()
iTotal_time = DateDiff("d", End_Time, Start_time)
Word_count = ActivePresentation.Slides.Count - 3
Reading_Time = Word_count / iTotal_time * 24 * 60
MsgBox "Evaluation : Your reading speed is " & Reading_Time & "words per minute"
End Sub