Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PowerPoint动态时钟的VBA代码_Vba_Powerpoint_Real Time Clock - Fatal编程技术网

PowerPoint动态时钟的VBA代码

PowerPoint动态时钟的VBA代码,vba,powerpoint,real-time-clock,Vba,Powerpoint,Real Time Clock,我想在PowerPoint中创建一个动态时钟,并将其显示在所有幻灯片的相同位置。下面是我一直致力于创建动态时钟的代码 与其说“直到1

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

与其说“直到1<0为止”,我可能想要类似于“直到PowerPoint退出幻灯片放映模式为止”的东西,但我不确定如何做到这一点

我尝试在PowerPoint幻灯片母版中创建一个形状,但不确定如何在代码的Shapes()部分中定义该形状。我只能够让时钟在形状(1)和形状(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
Sub-OnSlideShowPageChange()
暗时间为日期
将计数设置为整数
时间=现在()
直到1<0为止
多芬特
具有
ActivePresentation.Slides(SlideShowWindows(1.View.CurrentShowPosition).Shapes(1.TextFrame.TextRange)
.Text=格式((Now()),“hh:mm:ss”)
以
环
端接头