从VBA定义的宏创建PowerPoint加载项 [英] Creating PowerPoint Add-Ins from VBA defined Macros

查看:555
本文介绍了从VBA定义的宏创建PowerPoint加载项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我已经在PowerPoint演示文稿中创建了一个宏,我想使此宏可供其他人使用.根据我的收集,最好的方法是创建一个加载项.

So I've created a Macro in a PowerPoint Presentation and I would like to make this Macro readily available to someone else. From what I have gathered, the best way to do this is to create an Add-in.

我看过几篇文章,指出要执行以下操作,但是我仍然遇到问题:

I have come across several articles stating to do the following, but I am still running into problems:

  1. 打开新的PowerPoint演示文稿
  2. 使用VBA创建宏
  3. 退出VBA,并将演示文稿另存为.ppam
  4. 在开发人员"标签下,单击"PowerPoint加载项"按钮
  5. 单击添加新..."选项,然后浏览找到您最近创建的 .ppam文件
  6. 点击加载
  7. 点击关闭
  8. 点击加载项
  9. 您现在应该看到新的加载项
  1. Open a new PowerPoint Presentation
  2. Create a macro using VBA
  3. Exit VBA, and save the Presentation as a .ppam
  4. Under the Developer Tab, click on the "PowerPoint Add-ins" button
  5. Click the "Add New..." option, and browse for your recently created .ppam file
  6. Click Load
  7. Click Close
  8. Click Add-ins
  9. You should now see your new Add-in

我已经完成了上述所有操作,并且当我选择 PowerPoint加载项时,甚至可以看到新加载项.我在这里是因为我找不到运行新加载项的方法,也不希望它在启动时自动加载或通过在幻灯片上创建按钮来干扰演示.相反,我希望允许用户从功能区运行此加载项.

I have done everything mentioned above and can even see the new Add-in when I select PowerPoint Add-Ins. I'm here because I can't find a way to run the new Add-in, and I don't want it to automatically load on startup or to interfere with the presentation by creating a button on the slides. As instead, I would like to allow the user to run this Add-in from the Ribbon.

有想法吗?

推荐答案

首先,另存为PPTM.然后另存为PPAM.如果您仅另存为PPAM,则以后将无法返回并编辑代码以解决问题.

First, save as PPTM. THEN save as PPAM. If you only save as PPAM, you won't be able to go back and edit your code later to correct problems.

要从功能区启动加载项,必须将RibbonX代码(一种XML类型)包含到PPAM或PPTM中(最好将其添加到PPTM中……它会自动成为PPAM的一部分,然后).

To launch your add-in from the ribbon, you must include RibbonX code (a type of XML) to your PPAM or PPTM (best to add it to the PPTM ... it'll become part of the PPAM automatically then).

关于RibbonX,有一本非常棒的书,它将为您节省大量时间: http://www.amazon.com/RibbonX-Customizing- Office-2007-Ribbon/dp/0470191112

There's an excellent book on RibbonX that'll save you hours of time: http://www.amazon.com/RibbonX-Customizing-Office-2007-Ribbon/dp/0470191112

如果您不想买这本书,这是一个很好的起点: https://blogs.msdn.microsoft.com/jensenh/tag/all-office-2007-ui-posts/

This is a good starting point if you don't want to buy the book: https://blogs.msdn.microsoft.com/jensenh/tag/all-office-2007-ui-posts/

虽然您可以手动解压缩PPTM/PPTX/PPAM文件并使用任何文本编辑器添加RibbonX代码,但这样做很愚蠢.而是使用此免费工具:

While you can manually unzip PPTM/PPTX/PPAM files and add the RibbonX code using any text editor, it's silly to do so. Instead use this free tool:

http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2009/08/07/7293.aspx

这篇关于从VBA定义的宏创建PowerPoint加载项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆