`
cjc
  • 浏览: 654374 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

VBA 实现 POWERPOINT 的TIMER 事件

阅读更多

POWERPOINT 无TIMER 控件,也不支持 TIMER 事件。但如果想在播放POWERPOINT 时显示一个动态的时间,有没有可行的办法?笔者曾为此十分苦恼,四处求救,始终没有满意的答复(多数建议添加FLASH 格式的CLOCK),近日想起了延时函数SLEEP,一试竟然成功,问题终于得以解决,特此与广大CSDN朋友共享。代码如下

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub main()
ActivePresentation.SlideMaster.HeadersFooters.Footer.Text = Format(Time, "hh:nn:ss")
Do While Time < #11:59:00 PM#
Sleep 1000
ActivePresentation.SlideMaster.HeadersFooters.Footer.Text = Format(Time, "hh:nn:ss")
DoEvents
Loop
End Sub

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics