簡體   English   中英

Office 2010的“自定義”選項卡/組中添加包含不需要的命令

[英]Office 2010 Add in custom tab/group contains unwanted commands

我繼承了Excel 2010 VSTO,它在其自己的選項卡下具有一個按鈕以啟動一些代碼(我也是VS和C#的新手)。

我的問題是,在部署它時,“菜單命令”和“工具欄命令”組下出現了額外的命令; 這些屬於具有Excel集成功能的其他應用程序,但不屬於自己的標簽/組。

我已經在解決方案中搜索了對菜單和工具欄的引用,但是在任何地方都看不到它們。

功能區上的“我的標簽”是;

檔案| 主頁| 插入| 頁面布局 公式| 數據 評論| 查看| 開發人員 Boyce Tools 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>(); }
    }
}

}'

在調試模式下運行時,僅在開發機上存在問題。

在發布模式或VSTO的實際安裝版本中,這不是問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM