将按钮添加到第三方功能区选项卡加载项 [英] Adding a button to a 3rd party ribbon tab addin

查看:211
本文介绍了将按钮添加到第三方功能区选项卡加载项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Word 2010中有一个第三方插件,并且无法访问源代码。插件会添加一个新的功能区选项卡,并在由第三方插件生成的功能区选项卡中添加许多组。

I have a 3rd party addin in word 2010 and do not have access to the source code. The addin adds a new ribbon tab and many groups in the ribbon tab generated by the 3rd party addin.

我了解如何使用vb2013来创建自己的新功能区选项卡等我的问题是,是否可以创建一个新单词2010插件,该插件以某种方式在第三方插件的功能区选项卡上得到处理,并向第三方功能区选项卡中的一个组添加按钮?

I understand how to use vb2013 to create my own new ribbon tab etc. My question is, is it possible for me a create a new word 2010 addin, which somehow gets a handle on the 3rd party addin's ribbon tab and adds a button to one of the groups within the 3rd parties ribbon tab?

基本上,如果在单词中加载了第三方插件,则用户将获得第三方功能区标签。如果将第三方插件加上我可能的新插件添加到单词中,则用户应获得第三方功能区,以及我的个人插件生成的新按钮,该按钮会以某种方式出现在第三方功能区选项卡中。

So basically, if the 3rd party addin is loaded in word, the user will get the 3rd party ribbon tab. If the 3rd party addin plus my possible new addin is added to word, the user should get the 3rd party ribbon, plus my new button generated by my personal addin, which somehow appears in the 3rd party ribbon tab.

这可能吗?

推荐答案

根据Microsoft ,只有在您同时访问两者加载项。

According to Microsoft this is only possible if you have access to the source code of both add-ins.


如何创建两个将项添加到同一组或选项卡的加载项?

控件的 idQ 属性存在,可以为
共享容器(例如自定义标签)启用多个加载项和组。在下面的VBA
示例中,两个Excel加载项在
加载项选项卡上共享相同的 Contoso组。每个按钮都添加一个按钮。关键是在< customUI> 标记中指定
相同的唯一名称空间。然后,控件可以
通过使用 idQ 引用此命名空间。

The idQ property of controls exists to enable multiple add-ins to share containers, such as custom tabs and groups. In the following VBA example, two Excel add-ins share the same "Contoso" group on the add-ins tab; each adds one button to it. The key is specifying the same unique namespace in the <customUI> tag. Then, controls can reference this namespace by using idQ.

CustomUI XML对于加载项1:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" 
  xmlns:x="myNameSpace" >
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns">
        <group idQ="x:Contoso" label="Contoso">
          <button id="C1" label="Contoso Button 1" size="large" 
            imageMso="FileSave" onAction="c_action1" />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

外接程序2的CustomUI XML:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" 
  xmlns:x="myNameSpace" >
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns">
        <group idQ="x:Contoso" label="Contoso">
          <button id="C2" label="Contoso Button 2" size="large" 
            imageMso="FileSave" onAction="c_action2" />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>




如果您使用COM加载项自定义Fluent UI,命名空间名称
必须是COM加载项的 ProgID ,但其行为与
相同。当您使用共享加载项时, ProgID
AddInName 连接。当您使用
的Microsoft Visual Studio 2005工具2007 Microsoft Office System(Office
第二版的Visual Studio 2005工具)创建加载项时, ProgID
加载项的名称。

If you use a COM add-in to customize the Fluent UI, the namespace name must be the ProgID of the COM add-in, but the behavior is otherwise the same. When you use a shared add-in, the ProgID is AddInName.Connect. When you use Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System (Visual Studio 2005 Tools for Office Second Edition) to create the add-in, the ProgID is the name of the add-in.

因此,除非您尝试搭载的其他加载项已设置他们的功能区使用命名空间和idQ标签,则不太可能将控件放入功能区组/选项卡中。

So, unless the other add-in you are trying to piggyback has set up their ribbon using a namespace and the idQ-tag, it is unlikely that you'll be able to put your controls within it's ribbon groups/tabs.

这篇关于将按钮添加到第三方功能区选项卡加载项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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