excel - 如何使用 VSTO 在 Excel 中的自定义 xml 功能区中禁用其他工具栏

标签 excel vsto

这是一种情况:我用一些按钮为 Office(Word、Excel、PowerPoint)创建了自己的功能区。功能区是用 C#、VSTO、XML(不是 Designer)创建的。所以在所有这些程序中都有一个新的功能区,其中有一个功能区组,我的按钮在哪里。唯一的异常(exception)是 Excel,其中有一个“自定义工具栏”组在第一名,我的组在第二名。最好的部分是这个“Cutsom 工具栏”并没有出现在我安装了我的插件的每台计算机上。
我的问题:这个“自定义工具栏”如何显示在我创建的新功能区上,有什么方法可以禁用它?
功能区代码:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <ribbon startFromScratch="false">
    <tabs>
      <tab idMso="TabAddIns" label="MyAddIn">
        <group id="GroupInclude" label="MyAddIn">
          <button id="saveMyAddIn" label="Save my file" getImage="imageButton" size="large"
             onAction="saveMyAddInButton" getEnabled="GetEnabled"
          />
          <button id="configurMyAddIn" label="MyAddIn Options" getImage="imageButton"
             onAction="configureMyAddInButton"
          />
          <button id="goToMyAddIn" label="Go to MyAddIn" getImage="imageButton"
             onAction="goToMyAddInButton"
          />
          <button id="aboutMyAddIn" label="About MyAddIn" getImage="imageButton"
             onAction="aboutMyAddInButton"
          />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

最佳答案

转到选项卡的属性
和更改 ControlIdTypeCustom为我解决了这个问题。 enter image description here

关于excel - 如何使用 VSTO 在 Excel 中的自定义 xml 功能区中禁用其他工具栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32243955/

相关文章:

excel - 将数字转换为相应的 Excel 列

c# - 如何安装色谱柱?

excel - Java 开源库从 excel 中生成数据透视表

php - 如何从 MySQL 导出到我的 PHP 站点中的 Excel 文件?

VSTO 3 RibbonX getLabel 回调失败

c# - Excel 2007 以编程方式最小化功能区但不是菜单栏

MySQL 数据库到 Excel(1 个表到 1 个工作表)

c# - 如何在 C# 中编写调用 C++ DLL 导出函数的 excel 插件

c# - 将 office VSTO 插件发布到 office store

.net - 以编程方式从 VSTO Excel 工作簿中读取 _AssemblyLocation