문제

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

간단히 말해서, 슬라이드 쇼는 마지막 슬라이드가 재생되었을 때만 불을 피우고 프레젠테이션을 클릭했습니다. 마지막 슬라이드가 재생되었을 때 슬라이드 쇼를 발사하고 싶습니다 ...

도움이 되었습니까?

해결책

PowerPoint 설정에는 다음과 같은 옵션이 있습니다. 검은면으로 끝납니다. 이것이 COM에 존재하는지 확인하고 사용 할 수 있습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top