演示文稿。添加方法(PowerPoint)Presentations.Add method (PowerPoint)

创建一个演示文稿。Creates a presentation. 返回一个代表新演示文稿的 Presentation 对象。Returns a Presentation object that represents the new presentation.

语法Syntax

表达式AddWithWindowexpression.Add (WithWindow)

_表达式_一个代表演示文稿对象的变量。expression A variable that represents a Presentations object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
WithWindowWithWindow 可选Optional MsoTriStateMsoTriState 是否在可视窗口中显示演示文稿。Whether the presentation appears in a visible window.

返回值Return value

演示文稿Presentation

备注Remarks

_WithWindow_参数值可以是下列MsoTriState常量之一。The WithWindow parameter value can be one of these MsoTriState constants.

常量Constant 说明Description
msoFalsemsoFalse 新演示文稿不可见。The new presentation isn't visible.
msoTruemsoTrue 默认值。The default. 在可视窗口中创建演示文稿。Creates the presentation in a visible window.

示例Example

本示例创建一个演示文稿,并在其中添加一张幻灯片,然后保存该演示文稿。This example creates a presentation, adds a slide to it, and then saves the presentation.

With Presentations.Add

    .Slides.Add Index:=1, Layout:=ppLayoutTitle

    .SaveAs "Sample"

End With


另请参阅See also

演示文稿对象Presentations Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.