Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/14.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
Vba 通过PowerPoint幻灯片放映(MacOS)以编程方式创建视频_Vba_Macos_Video_Export_Powerpoint - Fatal编程技术网

Vba 通过PowerPoint幻灯片放映(MacOS)以编程方式创建视频

Vba 通过PowerPoint幻灯片放映(MacOS)以编程方式创建视频,vba,macos,video,export,powerpoint,Vba,Macos,Video,Export,Powerpoint,有人知道如何让它在MacOS的PowerPoint上运行吗 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) ' Pr

有人知道如何让它在MacOS的PowerPoint上运行吗

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

你试过了吗?它起作用了吗?你收到错误消息了吗?错误消息说了什么?a)您是否尝试向CreateSampleVideo子例程传递MacOSX上可接受的文件名?和b)您是否检查了VBA IDE中的对象浏览器以了解示例中使用的方法和常量是否已定义?在PowerPoint 2011中,各种ppMediaTask常量可用,但CreateVideo方法不可用。也许它已经添加到PPT 2016/Mac中。在MacOS上仍然不起作用。但它却能在Windows上完美工作。现在没关系。谢谢你的帮助!;)