【问题标题】:Advancing Powerpoint Slide Show Animations Automatically Following Timing按照时间自动推进 Powerpoint 幻灯片放映动画
【发布时间】:2014-06-05 23:31:46
【问题描述】:

我有一个在 C# 中访问的幻灯片放映。它打开并出现在屏幕上,我可以手动逐步浏览它,但它已经在动画选项卡中设置了时间。如何才能根据 powerpoint 中 Animations 中的设置启动节目并运行?

Microsoft.Office.Interop.PowerPoint.Application app = null;
Microsoft.Office.Interop.PowerPoint.Presentation pres = null;
app = new Microsoft.Office.Interop.PowerPoint.Application();
app.SlideShowNextSlide += new Microsoft.Office.Interop.PowerPoint.EApplication_SlideShowNextSlideEventHandler(app_SlideShowNextSlide);
pres = app.Presentations.Open(filename,
                Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoFalse);
//I was hoping this line would just run my show with the timings but it does not.
pres.SlideShowSettings.Run();
pres.SlideShowWindow.View.First();

而手动推进我一直在做

pres.SlideShowWindow.View.Next();

【问题讨论】:

    标签: c# powerpoint


    【解决方案1】:

    事实证明,我只需要多一行来激活动画计时。

    pres.SlideShowSettings.ShowWithAnimation = Microsoft.Office.Core.MsoTriState.msoTrue; 
    

    完整代码

    Microsoft.Office.Interop.PowerPoint.Application app = null;
    Microsoft.Office.Interop.PowerPoint.Presentation pres = null;
    app = new Microsoft.Office.Interop.PowerPoint.Application();
    app.SlideShowNextSlide += new Microsoft.Office.Interop.PowerPoint.EApplication_SlideShowNextSlideEventHandler(app_SlideShowNextSlide);
    pres = app.Presentations.Open(filename,
                Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoFalse);
    pres.SlideShowSettings.ShowWithAnimation = Microsoft.Office.Core.MsoTriState.msoTrue;
    pres.SlideShowSettings.Run();
    pres.SlideShowWindow.View.First();
    

    【讨论】:

      猜你喜欢
      • 2012-10-13
      • 2018-05-01
      • 1970-01-01
      • 2011-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多