Powerpoint issue when quitting

前端 未结 1 1670
失恋的感觉
失恋的感觉 2021-01-27 04:49

I have some c# code which opens a Powerpoint slide, refreshes the graphs, and then quits.

This works fine, unless the user already has a Powerpoint slide open, in which

相关标签:
1条回答
  • 2021-01-27 05:23

    You could check how many other Presentations are open, and only quit if yours is the only one:

    ppPres.SaveAs(outputFilename);
    
    var presentations = ppApp.Presentations;
    
    if (presentations.Count <= 1)
    {
        ppPres.Close(); 
        ppApp.Quit();
    }
    
    0 讨论(0)
提交回复
热议问题