我想在PowerPoint中创建一个动态时钟,并让它显示在所有幻灯片上的相同位置 . 下面是我一直致力于创建动态时钟的代码 .

而不是“Do Until 1 <0”,我可能想要“Do Until PowerPoint Exit Slideshow Mode”这样的内容,但我不知道该怎么做 .

我尝试在PowerPoint幻灯片母版中创建一个形状,但我不确定如何在代码的Shapes()部分中定义该形状 . 我只能在Shapes(1)和Shapes(2)中运行时钟 - 即幻灯片中的默认文本框 .

Sub OnSlideShowPageChange()
  Dim time As Date
  Dim count As Integer

  time = Now()

  Do Until 1 < 0
    DoEvents

    With
      ActivePresentation.Slides(SlideShowWindows(1).View.CurrentShowPosition).Shapes(1).TextFrame.TextRange
      .Text = Format((Now()), "hh:mm:ss")
    End With
  Loop
End Sub