vba 编辑 .ppam 文件以自定义加载项

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17569893/
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 22:08:08  来源:igfitidea点击:

Edit a .ppam file for customizing an add-in

excel-vbapowerpoint-vbavbaexcel

提问by Vijay Ivaturi

I was provided an add-in for powerpoint as a .ppam file and another add-in for Excel as .xslm file. The add-in's work great, but I would like to customize them with some internal requirements.

我获得了一个 .ppam 文件形式的 powerpoint 加载项和另一个 Excel 加载项作为 .xslm 文件。插件的工作很好,但我想根据一些内部要求自定义它们。

My questions is - how to open the source code behind a .ppam file ( which I understand is a compiled version) to be able to perform the customizations.

我的问题是 - 如何打开 .ppam 文件(据我所知是编译版本)背后的源代码以便能够执行自定义。

回答by Steve Rindsberg

If it's a PPAM file, it was created in PowerPoint from a PPTM file saved as an add-in.

如果它是 PPAM 文件,则它是在 PowerPoint 中从另存为加载项的 PPTM 文件中创建的。

While you can edit loaded add-ins "in place" for testing purposes, you can't edit then save them. But you can export the add-in's modules then import them into a new PPTM file or copy/paste code between the two.

虽然您可以出于测试目的“就地”编辑加载的加载项,但您不能编辑然后保存它们。但是您可以导出加载项的模块,然后将它们导入新的 PPTM 文件或在两者之间复制/粘贴代码。

In order to get access to the modules/code of the loaded add-in, you need to make a registry change.

为了访问加载的加载项的模块/代码,您需要更改注册表。

IMPORTANT: Quit PowerPoint first.

重要提示:首先退出 PowerPoint。

Then go to:

然后去:

HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\PowerPoint\Options

HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\PowerPoint\Options

(That'd be for PPT 2010; substitute 16.0 in place of 14.0 for PPT 2016/365 and PPT 2019, 15.0 for PPT 2013, 12.0 for PPT 2007 and so on ... there's no 13.0)

(这适用于 PPT 2010;用 16.0 代替 PPT 2016/365 和 PPT 2019 的 14.0,用 15.0 代替 PPT 2013,用 12.0 代替 PPT 2007 等等......没有 13.0)

Add a new DWORD value: DebugAddins = 1

添加新的 DWORD 值: DebugAddins = 1

Start PPT again; now your loaded add-ins will appear in the VBA IDE. If they're not password protected, you'll be able to open them, edit for test purposes, and export the modules or copy/paste for use in a new PPTM file.

再次启动PPT;现在您加载的加载项将出现在 VBA IDE 中。如果它们没有密码保护,您将能够打开它们、出于测试目的进行编辑、导出模块或复制/粘贴以在新的 PPTM 文件中使用。

Be sure to export any modules you've changed fairly often; if you quit PPT or it crashes, you'll lose any changes since the last save.

请务必导出您经常更改的任何模块;如果您退出 PPT 或它崩溃,您将丢失自上次保存以来的所有更改。