自动宏 (PowerPoint VBA 参考)

通过为宏指定特殊名称,可以在执行启动 PowerPoint 等操作时自动运行它。 PowerPoint 将以下名称识别为自动宏或“自动”宏。

宏名称 运行条件
Auto_Open 在 PowerPoint 启动或已加载加载项时运行
Auto_Close 退出 PowerPoint 或卸载加载项时运行

PowerPoint 自动宏行为

和 自动宏Auto_OpenAuto_Close的行为与类似的宏AutoOpen不同,AutoClose在 Word 和 Excel 中。

PowerPoint 每次加载加载项 (*.ppam) 包含此宏的模块时,都会运行 Auto_Open 。 它将在 PowerPoint 应用程序启动时有效运行,或者使用 PowerPoint 加载项对话框添加加载项。

每次使用包含此 Auto_Close 宏的模块卸载加载项时,PowerPoint 都会运行 。 当 PowerPoint 应用程序处于关闭状态或使用 PowerPoint 加载项对话框卸载 加载项时,它将有效运行。