高考倒计时、中考倒计时 PPT小工具制作

高考倒计时、中考倒计时PPT小工具可以激发学生们的拼搏精神制作倒计时牌需要用到VBA也就是宏,确保您的电脑环境中OfficePowerpoint是完整安装了vba组件的。注意:在Powerpoint中pptx文件无法保存VBA宏编程内容

高考倒计时、中考倒计时 PPT小工具 可以激发学生们的拼搏精神
制作倒计时牌需要用到VBA也就是宏,确保您的电脑环境中Office Powerpoint 是完整安装了vba组件的。

注意:在Powerpoint中 pptx文件无法保存VBA宏编程内容,
Microsoft PowerPoint 启用宏的演示文稿后缀为 .pptm 。
Microsoft PowerPoint 启用宏的幻灯片放映 .ppsm
 
以下代码在Windows10 64位 Powerpoint 2016下运行通过:
Declare PtrSafe Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As LongPtr) As Long
Declare PtrSafe Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Public mTimer  As Long
 
'计时函数,每一秒钟运行一次
Sub timer()
  ss = DateDiff("s", Now, "2023-6-7 09:00:00")
  dd = ss \ 86400
  hh = (ss Mod 86400) \ 3600
  mm = (ss Mod 3600) \ 60
  ss = ss Mod 60
  Slide1.Label1.Caption = dd & "天 " & hh & "时 " & mm & "分 " & ss & "秒"
End Sub
 
'1s调用一次timer函数计算间隔时间
Sub start()
    mTimer = SetTimer(0, 0, 1000, AddressOf timer)
End Sub
 
'PPT开始展示时,调用start函数,开始显示计时
Sub OnSlideShowPageChange()
    Call start
End Sub
 
'PPT终止演示时,结束计时
Sub OnSlideShowTerminate()
    mTimer = KillTimer(0, mTimer)
End Sub 
 
如果您不想编程,想获取这个计时器的直接播放文件(高考日期为2023年6月7日9:00),我已经准备好了,
放在【课件工坊】的公众号,回复【高考倒计时】免费下载
 
作者:课件工坊 https://www.bilibili.com/read/cv18447772 出处:bilibili
 
声明:该文观点仅代表作者本人,如果侵犯了您的权利,请通知我们,我们会及时删除
上一篇2021-10-09