我正在尝试检测 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
。
关于c# - 获取 PowerPoint 演示文稿的当前缩放比例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36455810/