C# - way to programmatically advance Powerpoint slide show?

走远了吗. 提交于 2019-11-30 17:33:00

The method to advance programatically is "SlideShowWindow.View.Next". You can also use "SlideShowWindow.View.Previous" to go backwards.

Looks like there is a method called GotoSlide that will work, just needed to dig a little more! For instance:

int i = 0;
while (true)
{
    i++;
    objPres.SlideShowWindow.View.GotoSlide(i, MsoTriState.msoFalse);
    System.Threading.Thread.Sleep(5000);
}

I think you could do this to run them one at a time, for instance:

oSettings = objPres.SlideShowSettings
oSettings.StartingSlide = 3
oSettings.EndingSlide = 3

oSettings.Run()
Do While oApp.SlideShowWindows.Count >= 1
    System.Windows.Forms.Application.DoEvents()
Loop

You might have get a answer for you question, However for the people who will face the same kind of problem I will send a link for a opensource C# code which handles this kind of situation smoothly.

https://code.msdn.microsoft.com/office/How-to-Automate-control-23cd2a8f

Download the zip file, inside there is a c# project which controls power point slides perfectly

Best wishes folks.

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