Application.PresentationOpen 事件 (PowerPoint)

打开现有的演示文稿时发生,同时将该演示文稿添加到 Presentations 集合中。

语法

expressionPresentationOpen( _Pres_ )

表达 返回 Application 对象的表达式。

参数

名称 必需/可选 数据类型 说明
Pres 必需 Presentation 打开的演示文稿。

备注

有关使用 Application 对象的事件的信息,请参阅操作方法:使用 Application 对象事件

如果您的Visual Studio解决方案包括 Microsoft.Office.Interop.PowerPoint的引用,此事件将映射到以下类型:

  • Microsoft.Office.Interop.PowerPoint.EApplication_PresentationOpenEventHandler( PresentationOpen委托。)

  • Microsoft.Office.Interop.PowerPoint.EApplication_Event.PresentationOpen( PresentationOpen事件。)

示例

本示例修改第三种配色方案的背景色,再将修改后的配色方案应用于刚打开的演示文稿,并在幻灯片视图中显示该演示文稿。

Private Sub App_PresentationOpen(ByVal Pres As Presentation) 
    With Pres 
        Set CS3 = .ColorSchemes(3) 
        CS3.Colors(ppBackground).RGB = RGB(240, 115, 100) 
        With Windows(1) 
            .Selection.SlideRange.ColorScheme = CS3 
            .ViewType = ppViewSlide 
        End With 
    End With 
End Sub

另请参阅

Application 对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。