PowerPoint 2013-导出到视频的进度

powerpoint 2013 - progress for export to video
2021-06-10
  •  译文(汉语)
  •  原文(英语)

我正在开发一个从磁盘读取Powerpoint演示文稿并使用以下伪代码将其保存为视频格式的应用程序:

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 ...

该过程需要长时间才能完成,因此我想添加一个进度指示器.我知道可以使用此进度信息-从Powerpoint导出到视频时,Powerpoint本身会显示确切的进度栏.有没有办法读取此进度,将其作为事件获取,或者在Powerpoint API上戳一下以获取某种进度百分比?非常感谢所有帮助.

解决过程1

我认为轮询ResampleMediaTasks.PercentComplete可能会为您提供帮助.自己还没有尝试过,但是PPT VBA中的帮助(通常,可悲的是很少而且不完整)表明这正是您想要的

速聊1:
我只是尝试了这种方法,但是在导出到视频时,PercentComplete始终处于100%的状态.
速聊2:
奇怪的.听起来可能是一个错误.无论如何,恐怕没有其他想法.

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.

Solutions1

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

Talk1:
I just tried this route, but the PercentComplete is always at 100% when exporting to video.
Talk2:
Strange. Sounds like it might be a bug. In any case, no other ideas, I'm afraid.
转载于:https://stackoverflow.com/questions/19095550/powerpoint-2013-progress-for-export-to-video

本人是.net程序员,因为英语不行,使用工具翻译,希望对有需要的人有所帮助
如果本文质量不好,还请谅解,毕竟这些操作还是比较费时的,英语较好的可以看原文

留言回复
我们只提供高质量资源,素材,源码,坚持 下了就能用 原则,让客户花了钱觉得值
上班时间 : 周一至周五9:00-17:30 期待您的加入