explorer preview causes System.Runtime.InteropServices.COMException: Automation rights are not granted. on ActivePresentation.name
问题 public static PowerPoint.Presentation GetActivePPT(this PowerPoint.Application application) { try { if (App.Presentations.Count > 0) { return application.ActivePresentation; } else { return null; } } catch (Exception ex) { return null; } } I call this function like so: PowerPoint.Presentation ppPresentation = PowerPointApplication.GetActivePPT(); if(ppPresentation != null) { Console.WriteLine(ppPresentation.Name); } And I get a : COMException: Message:Presentation (unknown member) : Invalid