林创建播放PowerPoint幻灯片放映C#应用程序。幻灯片放映结束后,我想停止PowerPoint和再回到我的程序。 我遇到的问题是,我在幻灯片的结尾点击返回我的程序...

有没有办法,我可以禁用等待点击的方式?

private void ShowPresentation()
{
    String strPresentation, strPic;
    strPresentation = Application.StartupPath + "\\testje.ppt";

    bool bAssistantOn;

    //PowerPoint.Application objApp;
    PowerPoint.Presentations objPresSet;
    PowerPoint._Presentation objPres;
    PowerPoint.Slides objSlides;
    PowerPoint._Slide objSlide;
    PowerPoint.TextRange objTextRng;
    PowerPoint.Shapes objShapes;
    PowerPoint.Shape objShape;
    PowerPoint.SlideShowWindows objSSWs;
    PowerPoint.SlideShowTransition objSST;
    PowerPoint.SlideShowSettings objSSS;
    PowerPoint.SlideRange objSldRng;
    Graph.Chart objChart;

    //Create a new presentation based on a template.
    objApp = new PowerPoint.Application();
    objApp.SlideShowBegin += new Microsoft.Office.Interop.PowerPoint.EApplication_SlideShowBeginEventHandler(powerpnt_SlideShowBegin);
    objApp.SlideShowEnd += new Microsoft.Office.Interop.PowerPoint.EApplication_SlideShowEndEventHandler(powerpnt_SlideShowEnd);
    objApp.SlideShowNextSlide += new Microsoft.Office.Interop.PowerPoint.EApplication_SlideShowNextSlideEventHandler(powerpnt_SlideShowNextSlide);
    objApp.Visible = MsoTriState.msoTrue;
    objPresSet = objApp.Presentations;
    objPres = objPresSet.Open(strPresentation, MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
    objSlides = objPres.Slides;

    //Prevent Office Assistant from displaying alert messages:
    bAssistantOn = objApp.Assistant.On;
    objApp.Assistant.On = false;

    //Run the Slide show from slides 1 thru 3.
    objSSS = objPres.SlideShowSettings;
    objSSS.StartingSlide = 1;
    objSSS.EndingSlide = objSlides.Count;
    objSSS.Run();
}

private void powerpnt_SlideShowEnd(Microsoft.Office.Interop.PowerPoint.Presentation Pres)
{
    objApp.Quit();
}

概括地说,SlideShowEnd当最后滑动起到和我已单击上的呈现仅闪光。我想SlideShowEnd火时,最后一张幻灯片中发挥...

有帮助吗?

解决方案

在PowerPoint中设置有一个选项:结束与黑边您可以尝试,看看是否存在于COM,并用它

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top