在popwerpoint功能区中动态添加和删除用户控件 [英] Dynamically add and remove user controls in popwerpoint ribbon

查看:238
本文介绍了在popwerpoint功能区中动态添加和删除用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

是否可以在PowerPoint附加功能区中添加和删除用户控件?
如果可能的话,如何实现呢?

提前THX!

Olli

Hello everyone,

is it possible to add and remove usercontrols in a powerpoint addin ribbon?
And if it is possible, how is it achieved?

THX in advance!

Olli

推荐答案

是的,两者都是可能的.

功能区中的控件在XML文件中声明.我不知道一种遍历XML并直接添加/删除项目的方法.

为了更改添加到功能区的控件,您只需为每个控件配置维护一个XML文件.


举个例子-我遵循的关于excel插件的提示允许您切换复选框.如果选中了该框,则下拉控件将​​起作用.如果不是,则禁用该框.这需要两个XML文件.


这么长时间了,我不记得从启用宏的电子表格,xlsm插件或(vb.net)COM dll插件可以做什么的所有来龙去脉. />
尽管我似乎确实记得,您可以通过DLL进行某些操作,而您无法通过VBA进行处理.一个想到的例子是自定义图库控件.我制作了一个插件,用于显示工作表是否启用了打印边框-还允许轻松切换边框.我可以动态地画一张图片,并通过dll为书中的每张纸添加一个项目到相册中的每张纸上-我无法在VBA中执行相同的操作-功能区控件需要在XML文件中(预先)定义. br/>
用于Microsoft Office的自定义UI编辑器"是我用来生成XML的工具.
Yes, both are possible.

The controls in the ribbon are declared in an XML file. I''m not aware of a method to traverse the XML and add/remove items directly.

In order to change the controls that you add to the ribbon, you simply maintain an XML file for each of the control configurations that you have.


As an example - A tute I followed for excel addins allowed you to toggle a check-box. If the box was checked then a drop-down control would function. If it wasn''t then the box is disabled. This required two XML files.


It''s been such a long time, I can''t remember all of the ins and outs of what you can do from a macro-enabled spreadsheet, an xlsm addin or a (vb.net)COM dll addin.

Though I do seem to remember that you could do some things from a dll that you can''t do from VBA. An example that springs to mind is customizing of a gallery control. I made an addin that showed if sheets had print-borders enabled or not - also allowing the easy toggling of the borders. I could dynamically draw a picture and add an item to the gallery control for each sheet in the book from a dll - I could not do the same from within VBA - the ribbon controls needed to be (pre) defined in an XML file.

''Custom UI Editor for Microsoft Office'' was the tool I used to generate the XML.


这篇关于在popwerpoint功能区中动态添加和删除用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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