【问题标题】:Powerpoint time how long each slide is displayed forPowerPoint时间每张幻灯片显示多长时间
【发布时间】:2015-08-04 17:29:41
【问题描述】:

我正在制作一个幻灯片演示文稿,我需要计算每张幻灯片的显示时间,精确到小数点后 2 位,例如1.45秒,每次演示后都能检索。我猜最简单的方法是以某种方式使用 VB 计时器并将每个计时器存储为公共变量,但不知道如何开始。我使用 Visual Basic 的经验有限。

非常感谢任何帮助。

【问题讨论】:

    标签: vb.net vba powerpoint


    【解决方案1】:

    此功能存在于 powerpoint 中。

    http://www.howtogeek.com/howto/34395/how-to-time-your-powerpoint-slides-for-more-effective-presentations/

    编辑。 为了更准确的计时:此示例将在每次更改幻灯片时在消息框中显示计时..

    Public Declare Function GetTickCount Lib "kernel32.dll" () As Long
    Public startTime As Long
    
    Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
        If SSW.View.CurrentShowPosition = 1 Then
            startTime = GetTickCount()
        Else
            MsgBox GetTickCount() - startTime
        End If
    End Sub
    

    而不是消息框,将其放入文件或其他内容中。

    Public Declare Function GetTickCount Lib "kernel32.dll" () As Long
    
    Public startTime As Long
    Public strPath As String
    
    Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
        Const ForReading = 1, ForWriting = 2, ForAppending = 8
        strPath = "timing.txt"
        Dim fs, f
    
        If SSW.View.CurrentShowPosition = 1 Then
            startTime = GetTickCount()
    
            Set fs = CreateObject("Scripting.FileSystemObject")
            Set f = fs.CreateTextFile("d:\testfile.txt", True)
            f.WriteLine "Started new presentation"
            f.Close
        Else
            Dim DeltaTime As Long
            DeltaTime = GetTickCount() - startTime
    
            Set fs = CreateObject("Scripting.FileSystemObject")
            Set f = fs.OpenTextFile("d:\testfile.txt", ForAppending, TristateFalse)
    
            f.Write "time in milliseconds since start: "
            f.WriteLine Str(DeltaTime)
            f.Close
        End If
    End Sub
    

    【讨论】:

    • 对不起,我的时间超过了小数点后 2 位,例如 1.45 秒,我会编辑原帖
    • 也可以在不使用计时器的情况下使用 PresentationElapsedTime 和 SlideElapsedTime 属性的组合来跟踪。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-08
    • 1970-01-01
    • 2019-07-07
    • 2013-08-05
    • 2020-06-30
    • 1970-01-01
    相关资源
    最近更新 更多