小说网 找小说 无限小说 烟雨红尘 幻想小说 酷文学 深夜书屋

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

posted on 2005-10-09 22:02  王峰炬  阅读(297)  评论(0编辑  收藏  举报

导航