PowerPoint.Application PowerPoint_App;
PowerPoint_App = new PowerPoint.ApplicationClass();
PowerPoint_App.DisplayAlerts = PowerPoint.PpAlertLevel.ppAlertsNone;
PowerPoint.Presentation presentation;
presentation = null;
try
{
    PowerPoint_App.Visible = MsoTriState.msoTrue;
    presentation = PowerPoint_App.Presentations.Open(strPptFilePath, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse);
    PowerPoint.Slide tempSlide = null;
    int totalSlides = presentation.Slides.Count;
    int slideNo = 0;

我在PowerPoint_App.Presentations.Open代码上遇到以下异常。



我之前在此代码块上没有收到此错误。之前一切都很好。有人可以帮忙吗?

最佳答案

我最终删除了:

 PowerPoint_App.Visible = MsoTriState.msoTrue;

它奏效了... !!!

09-06 12:04