powerpoint 2013 - progress for export to video

十年热恋 提交于 2019-12-23 01:52:14

问题


I'm working on an application which reads a Powerpoint presentation from disk and saves it in video format using the following pseudocode:

var app = new ppt.Application();
ppt.Presentation file = app.Presentations.Open(
                this.SourceFilename,
                MsoTriState.msoFalse,
                MsoTriState.msoFalse,
                MsoTriState.msoFalse);
file.CreateVideo(this.DestinationFilename);
while (true)
{
    switch (file.CreateVideoStatus)
    {
        case PpMediaTaskStatus.ppMediaTaskStatusDone: ...
        case PpMediaTaskStatus.ppMediaTaskStatusFailed: ...
        case PpMediaTaskStatus.ppMediaTaskStatusInProgress ...

this process takes very long to complete, so I would like to add a progress indicator. I know that this progress information is available - Powerpoint itself shows an exact progress bar when exporting to video from within powerpoint. Is there a way to read this progress, get this as an event, or poke around the powerpoint api to get some kind of progress percentage? All help is greatly appreciated.


回答1:


I think that polling ResampleMediaTasks.PercentComplete might give you what you're after. Haven't tried it myself but the (as usual, pathetically scant and incomplete) help in PPT VBA suggests that it's what you want



来源:https://stackoverflow.com/questions/19095550/powerpoint-2013-progress-for-export-to-video

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!