获取 PowerPoint 演示文稿的当前缩放比例

Getting the current zoom of a powerpoint presentation

我正在尝试检测 Powerpoint 演示文稿的当前缩放比例。以下是我刚刚写的代码:

Microsoft.Office.Interop.PowerPoint.Application application = new Microsoft.Office.Interop.PowerPoint.Application();
Presentation presentation = application.Presentations.Open(file_name);

application.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;
if (document.SlideShowWindow.View.Zoom == 90) { blah }

我收到以下错误,无法找出原因:

An exception of type 'System.Runtime.InteropServices.COMException' occurred in ICTeacher.exe but was not handled in user code

Additional information: Presentation (unknown member) : Invalid request.  There is currently no slide show view for this presentation.

导致错误的行是document.SlideShowWindow.View.Zoom == 90

我做错了什么?

已解决,我需要:Application.ActiveWindow.View.Zoom 而不是 document.SlideShowWindow.View.Zoom