vba 在 PowerPoint 2007 中将宏另存为插件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11084747/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 16:31:24  来源:igfitidea点击:

Saving macro as addin in PowerPoint 2007

vbaadd-inpowerpointpowerpoint-2007

提问by haver24

I've got a question concerning addins in PowerPoint 2007.

我有一个关于 PowerPoint 2007 插件的问题。

It is possible to save a macro as an addin and then use it as a button in all PP presentations? I know it's possible in Excel..but how about PowerPoint?

是否可以将宏另存为插件,然后在所有 PP 演示文稿中将其用作按钮?我知道在 Excel 中是可能的……但是 PowerPoint 怎么样?

回答by Steve Rindsberg

Yes. The presentation should include any macros you want to make available and also some code to create any needed buttons/toolbars to invoke the macros. Usually this will go in an Auto_Open subroutine (which will fire automatically whenever the add-in loads).

是的。演示文稿应包括您想要提供的任何宏,以及一些用于创建任何需要的按钮/工具栏以调用宏的代码。通常这将进入 Auto_Open 子例程(每当加载项加载时会自动触发)。

This page on my PPT FAQ site explains how to do this in a way that's compatible with all current versions of PPT/Windows:

我的 PPT 常见问题网站上的这个页面解释了如何以与所有当前版本的 PPT/Windows 兼容的方式执行此操作:

Create an ADD-IN with TOOLBARS that run macros

使用运行宏的工具栏创建加载项

It'll create toolbars/buttons that appear on an Add-ins tab in PPT 2007 and up.
If you want to create buttons on the PPT ribbon, it gets a bit more complicated.

它将创建出现在 PPT 2007 及更高版本的插件选项卡上的工具栏/按钮。
如果你想在 PPT 功能区上创建按钮,它会变得更复杂一些。