Office 2010添加自定义选项卡/组包含不需要的命令
本文关键字:包含 不需要 命令 2010 添加 自定义 选项 Office | 更新日期: 2023-09-27 18:07:58
我继承了一个Excel 2010 VSTO,它在自己的标签下有一个按钮来启动一些代码(我也是VS和c#的新手)。
我的问题是,当我部署它,我得到额外的命令出现在"菜单命令"answers"工具栏命令"组;这些属于其他有Excel集成但没有自己的选项卡/组的应用程序。
我已经在解决方案中搜索了菜单和工具栏的引用,但在任何地方都看不到它们。
我的标签栏在功能区的位置是;
文件|首页|插入|页面布局|公式|数据|回顾|视图|开发者|博伊斯工具2(我的插件)|其他添加在1 |其他添加在2 |其他添加在3 |其他添加在4 |
我已经为标签和组'Boyce Tools 2'指定了名称,所以只是不确定这些其他命令是如何到达那里的?是否有可能其他添加只是默认到第一个选项卡,而不是office MS的一个?
Ribbon.Designer.cs
namespace ReportFramework
{
partial class Ribbon : Microsoft.Office.Tools.Ribbon.RibbonBase
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
public Ribbon()
: base(Globals.Factory.GetRibbonFactory())
{
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabBoyceTools = this.Factory.CreateRibbonTab();
this.grpBoyceCAL = this.Factory.CreateRibbonGroup();
this.btnGenerateCAL = this.Factory.CreateRibbonButton();
this.tabBoyceTools.SuspendLayout();
this.grpBoyceCAL.SuspendLayout();
//
// tabBoyceTools
//
this.tabBoyceTools.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office;
this.tabBoyceTools.Groups.Add(this.grpBoyceCAL);
this.tabBoyceTools.Label = "Boyce Tools 2";
this.tabBoyceTools.Name = "tabBoyceTools";
//
// grpBoyceCAL
//
this.grpBoyceCAL.Items.Add(this.btnGenerateCAL);
this.grpBoyceCAL.Label = "CAL";
this.grpBoyceCAL.Name = "grpBoyceCAL";
//
// btnGenerateCAL
//
this.btnGenerateCAL.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
this.btnGenerateCAL.Label = "Format CAL";
this.btnGenerateCAL.Name = "btnGenerateCAL";
this.btnGenerateCAL.OfficeImageId = "MacroPlay";
this.btnGenerateCAL.ShowImage = true;
this.btnGenerateCAL.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnGenerateCAL_Click);
//
// Ribbon
//
this.Name = "Ribbon";
this.RibbonType = "Microsoft.Excel.Workbook";
this.Tabs.Add(this.tabBoyceTools);
this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.Ribbon_Load);
this.tabBoyceTools.ResumeLayout(false);
this.tabBoyceTools.PerformLayout();
this.grpBoyceCAL.ResumeLayout(false);
this.grpBoyceCAL.PerformLayout();
}
#endregion
internal Microsoft.Office.Tools.Ribbon.RibbonTab tabBoyceTools;
internal Microsoft.Office.Tools.Ribbon.RibbonGroup grpBoyceCAL;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnGenerateCAL;
}
partial class ThisRibbonCollection
{
internal Ribbon Ribbon
{
get { return this.GetRibbon<Ribbon>(); }
}
}
}'
仅在dev机器上运行在调试模式时出现问题。
在发布模式或VSTO的实际安装版本中,这不是问题