简体   繁体   English

如何在功能区(Visual Designer)中禁用Excel内置的RibbonButton?

[英]How to disable Excel built-in RibbonButton in Ribbon (Visual Designer)?

是否可以从excel VSTO加载项中将enabled=false内置的Excel 2010设置为enabled=false

Here is a sample for Word, using Ribbon XML. 这是使用Ribbon XML的Word示例。 I don't think you can use the ribbon designer for this. 我认为您不能为此使用功能区设计器。 The same thing should work in Excel as well. 同样的事情也应该在Excel中工作。

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <commands>
    <command idMso="Font" enabled="false" />
  </commands>
</customUI>

This disables the command , which includes not just the buttons in the ribbon, but also any other way it could be triggered, eg through a keyboard shortcut. 这将禁用该命令 ,该命令不仅包括功能区中的按钮,还包括其他可以通过键盘快捷方式触发的方式。

If you want to do anything more specific you may have to re-create standard ribbons or ribbon groups. 如果要执行更具体的操作,则可能必须重新创建标准色带或色带组。 Eg you can't just disable Font while leaving all other placements enabled. 例如,您不能仅禁用Font而要启用所有其他展示位置。 You would have to hide the standard Home tab and re-create it but with your specific changes (disabled, missing, etc.). 您将不得不隐藏标准的“主页”选项卡并重新创建它,但是要进行特定的更改(禁用,丢失等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM