3

在 powerpoint 2010 中引入了一种新的视图类型,称为“阅读视图”。我正在尝试将其应用于演示文稿,但办公室互操作的 PpViewType 枚举不包含任何将演示文稿视图修改为“阅读视图”的成员。任何人都可以帮助我是否已在其他地方定义或者我如何以编程方式更改为阅读视图?

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;
4

1 回答 1

0

您似乎无法直接从对象模型切换到阅读视图,但您可以将其近似为 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
于 2014-03-20T12:35:12.717 回答