实现效果:
1。鼠标移过“现在时间”图形时,显示当前实时电脑时间。
2。在宏内设置休息时间,时间到点后,提示休息时间结束。
主要宏代码: Sub clock()
With ActivePresentation.Slides(2)
.Shapes("over").TextFrame.TextRange.Text = ""
.Shapes("clock").TextFrame.TextRange.Text = Format(time, "hh:mm:ss")
For i = 1 To 20 ‘此对应10S休息时间,如休息1分钟,相应设置为 120 t1 = Timer
While Timer - t1 < 0.5
DoEvents
Wend
.Shapes("clock").TextFrame.TextRange.Text = Format(time, "hh:mm:ss")
Next
.Shapes("clock").TextFrame.TextRange.Text = ""
.Shapes("over").TextFrame.TextRange.Text = "休息结束"
End With
End Sub