以编程方式从PowerPoint幻灯片创建视频(MacOS)

时间:2017-02-20 15:59:56

标签: vba macos video export powerpoint

有人知道如何在PowerPoint for MacOS上使用它吗?

Sub TestCreateSampleVideo()
    ' Change the file path and name as required.
    CreateSampleVideo ActivePresentation, "C:\TEMP\Video.wmv"
End Sub

Sub CreateSampleVideo(pres As Presentation, fileName As String)
    ' Presentation.CreateVideo does its work asynchronously.
    ' You can use the Presentation.CreateVideoStatus property
    ' to periodically check the status, and react accordingly.

    pres.CreateVideo fileName, DefaultSlideDuration:=1, VertResolution:=480

    ' Now wait for the conversion to be complete:
    Do
        ' Don't tie up the user interface; add DoEvents
        ' to give the mouse and keyboard time to keep up.
        DoEvents
        Select Case pres.CreateVideoStatus
            Case PpMediaTaskStatus.ppMediaTaskStatusDone
                MsgBox "Conversion complete!"
                Exit Do
            Case PpMediaTaskStatus.ppMediaTaskStatusFailed
                MsgBox "Conversion failed!"
                Exit Do
            Case PpMediaTaskStatus.ppMediaTaskStatusInProgress
                Debug.Print "Conversion in progress"
            Case PpMediaTaskStatus.ppMediaTaskStatusNone
                ' You'll get this value when you ask for the status 
                ' and no conversion is happening or has completed.
            Case PpMediaTaskStatus.ppMediaTaskStatusQueued
                Debug.Print "Conversion queued"
        End Select
    Loop
End Sub

https://msdn.microsoft.com/en-us/library/office/gg985312(v=office.14).aspx#Anchor_2

0 个答案:

没有答案