如何在 PowerPoint 中嵌入 ActiveX 控件
我有一个用 C# 编写的 ActiveX 控件。我可以在我的计算机上注册它并通过开发人员功能区放入 PowerPoint 2007 幻灯片。效果很好!
但是,我不希望我的用户必须在他们的计算机上安装该控件。我想将其直接嵌入到 PowerPoint 文件中。
我见过 Flash 内容是这样实现的。 PPTX 文件有一个“bin”目录,实际的 Flash COM DLL 放置在其中。
但是,我的 PPTX 文件只有 activex 目录,因此依赖于全局注册的控件。
如何让 PowerPoint 完全嵌入此控件?
澄清 我发现“bin”中的文件实际上直接是已注册的 Flash ActiveX 控件仅消耗的 SWF 文件。该死。
I have an ActiveX control written in C#. I am able to register it on my machine and put in PowerPoint 2007 slides via the Developer ribbon. Works great!
However, I don't want my users to have to install the control on their machines. I want to embed it directly into the PowerPoint file.
I have seen this done with Flash content. The PPTX file gets a "bin" directory and the actual Flash COM DLL is placed in it.
However, my PPTX files only have the activex directory and therefore rely on the control being globally registered.
How do I get PowerPoint to completely embed this control?
Clarification I have since found that the files in the "bin" directly were in fact SWF files that an already-registered Flash ActiveX control merely consumed. Darn.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在这样做时看到了几个问题。如果用户禁用了 ActiveX 控件(ActiveX 安全设置 - Microsoft Office 安全),脚本/宏也是如此。如果用户没有安装所需的 .net 框架(因为这是 C# 问题,我想 ActiveX 是在 C# 中完成的),或者运行 ActiveX 所需的任何其他运行时怎么办?
每个 ActiveX 都必须先注册才能使用。如果您幸运并且用户启用了 ActiveX/脚本,那么您可以尝试通过嵌入在您的 Power Point 演示文稿中的 VBScript 来注册您的 ActiveX。您可以通过 Wscript.Shell 使用 RegSvr32(静默模式),也可以查找本机 (API) 函数。
Couple of problems that i can see in doing this. What if user has disabled ActiveX controls ( ActiveX security settings - Microsoft Office Security ), a same thing for scripts / macros. What if user does not have required .net framework installed (since it's C# question, i suppose ActiveX is done in C#), or any other runtime required to run your ActiveX?.
Each and every ActiveX has to be registered before it can be used. If you are lucky and user has activex/scripting enabled, then you can try to register your ActiveX via VBScript embeded in your power point presentation. You can use RegSvr32 (silent mode) thru Wscript.Shell or you can look for native (API) functions.