首页 > 解决方案 > 在 Powerpoint 中显示具体的运行时间

问题描述

我几乎在任何地方都尝试过查找这个,但仍然没有运气..

我已经能够在 PowerPoint 中创建一个实时运行的时钟,但是有没有办法让它成为一个特定的时间?前任。我希望时间从下午 2:20:00 开始,尽管那可能不是当前时间并运行?

目前我正在使用

Public clock as Boolean

Public currenttime, currentday as string

Sub Pause()
Dim PauseTime, start
PauseTime = 1
start = Timer
Do While Timer < start + PauseTime
DoEvents 
Loop 
End Sub

Sub StartClock()
clock = Time
Do Until clock = false
On Error Resume Next
currentime = Format ((Now()), "hh:mm:ss AM/PM")
currentime = Mid(currenttime, 1, Len(currenttime) - 3)
ActivePresentation.Slides(SlideShowWindows(1).View.CurrentShowPosition).Shapes("TimeTest").TextFrame.TextRange.Text = currenttime
Pause
Loop 
End Sub

Sub OnSlideShowPageChange(ByVal objWindows As SlideShowWindow)
clock = false
ActivePresentation.Slides(SlideShowWindows(1).View.CurrentShowPosition).Shapes("TimeTest").TextFrame.TextRange.Text = "--:--:--"
End Sub

Sub OnSlideShowTerminate()
clock = false
End Sub

我在我看过的一个 YouTube 视频上发现了这个,它成功地显示了当前时间,但现在我该如何改变它来显示一个特定的时间?

标签: powerpoint

解决方案


这应该这样做:

Currentime = format("2:20 PM","hh:mm:ss AM/PM")

使用它代替现有的两条 Currentime= 行


推荐阅读