Powerpoint 2010 中引入了一种新的 View 类型,称为“阅读 View ”。我正在尝试将它应用于演示文稿,但办公室互操作的 PpViewType 枚举不包含任何将演示文稿 View 修改为“阅读 View ”的成员。任何人都可以帮助我它是否已在其他地方定义或我如何以编程方式更改为阅读 View ?
PowerPoint.Application oPPT = new PowerPoint.Application();
//Add New Presentation
PowerPoint.Presentations oPresSet = oPPT.Presentations;
PowerPoint.Presentation oPres = oPresSet.Add(Office.MsoTriState.msoTrue);
//Add Slides to the Presentation
PowerPoint.Slides oSlides = oPres.Slides;
PowerPoint.Slide oSlide = oSlides.Add(1, PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
oSlide.Shapes[1].TextFrame.TextRange.Text ="sample text";
//Changing View Type
oPres.Application.ActiveWindow.ViewType = PowerPoint.PpViewType.ppViewNotesPage;
最佳答案
您似乎无法直接从对象模型切换到阅读 View ,但您可以将其近似用于 Office 2010+ 中的只读演示文稿文件:
- 使用 ppShowTypeWindow2 的 ShowType 开始幻灯片放映。
- 关闭原来的DocumentWindow
- 将演示文稿标记为已保存。
VBA 示例
Dim pres As Presentation
Dim settings As SlideShowSettings
Set pres = ActivePresentation
Set settings = pres.SlideShowSettings
settings.ShowType = ppShowTypeWindow2
settings.Run
pres.Windows(1).Close
pres.Saved = msoTrue
关于c# - 如何以编程方式将 powerpoint View 类型更改为阅读 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9061103/