Pergunta

Im criação de um aplicativo C # que reproduz uma apresentação de slides do PowerPoint. Após a apresentação terminou Quero parar powerpoint e retorno ao meu programa novamente. O problema que estou tendo é que eu tenho que clicar no término da apresentação de slides para voltar ao meu programa ...

Existe uma maneira que eu posso desativar a esperar por um clique?

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();
}

Em poucas palavras, SlideShowEnd só é acionado quando o último slide tem desempenhado e eu ter clicado na apresentação. Quero SlideShowEnd ao fogo quando o último slide tem desempenhado ...

Foi útil?

Solução

No PowerPoint configurações há uma opção:.. End com o lado negro Você pode tentar para ver se isso existe no COM e usá-lo

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top