Outlook加载项:自定义功能区在主应用程序窗口中不可见,尽管RibbonType包含在Microsoft.Outlook.Explorer中

问题描述 投票:0回答:1

我创建了一个Outlook 2016外接程序,使用功能区设计器可以在Inspector的Windows约会中完美显示。根据documentation,我添加了RibbonType Microsoft.Outlook.Explorer。

我希望它也会出现在Outlook的开始屏幕上:enter image description here

此外,我找不到任何合适的RibbonType进行额外设置,以便Addin在开始屏幕上显示。我应该添加什么?enter image description here

我在哪里可以找到有关如何自定义Outlook功能区的很好的其他文档?我必须切换到XML自定义吗?是否有关于如何从Designer转换为XML的文档?

我还提供了设计者代码:

namespace OutlookAddIn4
{
    partial class MyAddIn : Microsoft.Office.Tools.Ribbon.RibbonBase
    {
        /// <summary>
        /// Erforderliche Designervariable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        public MyAddIn()
            : base(Globals.Factory.GetRibbonFactory())
        {
            InitializeComponent();
        }

        /// <summary> 
        /// Verwendete Ressourcen bereinigen.
        /// </summary>
        /// <param name="disposing">"true", wenn verwaltete Ressourcen gelöscht werden sollen, andernfalls "false".</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Vom Komponenten-Designer generierter Code

        /// <summary>
        /// Erforderliche Methode für Designerunterstützung -
        /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
        /// </summary>
        private void InitializeComponent()
        {
            this.tab1 = this.Factory.CreateRibbonTab();
            this.group1 = this.Factory.CreateRibbonGroup();
            this.btnAddMyAddIn = this.Factory.CreateRibbonButton();
            this.btnViewInMyAddIn = this.Factory.CreateRibbonButton();
            this.btnRemoveFromMyAddIn = this.Factory.CreateRibbonButton();
            this.btnSettings = this.Factory.CreateRibbonButton();
            this.tab1.SuspendLayout();
            this.group1.SuspendLayout();
            this.SuspendLayout();
            // 
            // tab1
            // 
            this.tab1.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office;
            this.tab1.ControlId.OfficeId = "TabAppointment";
            this.tab1.Groups.Add(this.group1);
            this.tab1.Label = "TabAppointment";
            this.tab1.Name = "tab1";
            // 
            // group1
            // 
            this.group1.Items.Add(this.btnAddMyAddIn);
            this.group1.Items.Add(this.btnViewInMyAddIn);
            this.group1.Items.Add(this.btnRemoveFromMyAddIn);
            this.group1.Items.Add(this.btnSettings);
            this.group1.Label = "MyAddIn";
            this.group1.Name = "group1";
            this.group1.Position = this.Factory.RibbonPosition.AfterOfficeId("GroupActions");
            // 
            // btnAddMyAddIn
            // 
            this.btnAddMyAddIn.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
            this.btnAddMyAddIn.Image = global::OutlookAddIn4.Properties.Resources.do_48x48;
            this.btnAddMyAddIn.Label = "Add Minutes";
            this.btnAddMyAddIn.Name = "btnAddMyAddIn";
            this.btnAddMyAddIn.ShowImage = true;
            this.btnAddMyAddIn.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.BtnAddMyAddIn_Click);
            // 
            // btnViewInMyAddIn
            // 
            this.btnViewInMyAddIn.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
            this.btnViewInMyAddIn.Image = global::OutlookAddIn4.Properties.Resources.do_48x48;
            this.btnViewInMyAddIn.Label = "View Minutes";
            this.btnViewInMyAddIn.Name = "btnViewInMyAddIn";
            this.btnViewInMyAddIn.ShowImage = true;
            this.btnViewInMyAddIn.Visible = false;
            this.btnViewInMyAddIn.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.ViewInMyAddIn_Click);
            // 
            // btnRemoveFromMyAddIn
            // 
            this.btnRemoveFromMyAddIn.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
            this.btnRemoveFromMyAddIn.Image = global::OutlookAddIn4.Properties.Resources.do_48x48;
            this.btnRemoveFromMyAddIn.Label = "Remove Minutes";
            this.btnRemoveFromMyAddIn.Name = "btnRemoveFromMyAddIn";
            this.btnRemoveFromMyAddIn.ShowImage = true;
            this.btnRemoveFromMyAddIn.Visible = false;
            this.btnRemoveFromMyAddIn.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.RemoveFromMyAddIn_Click);
            // 
            // btnSettings
            // 
            this.btnSettings.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
            this.btnSettings.Image = global::OutlookAddIn4.Properties.Resources.do_48x48;
            this.btnSettings.Label = "Settings";
            this.btnSettings.Name = "btnSettings";
            this.btnSettings.ShowImage = true;
            this.btnSettings.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.Settings_Click);
            // 
            // MyAddIn
            // 
            this.Name = "MyAddIn";
            this.RibbonType = "Microsoft.Outlook.Appointment, Microsoft.Outlook.Explorer";
            this.StartFromScratch = true;
            this.Tabs.Add(this.tab1);
            this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.MyAddIn_Load);
            this.tab1.ResumeLayout(false);
            this.tab1.PerformLayout();
            this.group1.ResumeLayout(false);
            this.group1.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        internal Microsoft.Office.Tools.Ribbon.RibbonTab tab1;
        internal Microsoft.Office.Tools.Ribbon.RibbonGroup group1;
        internal Microsoft.Office.Tools.Ribbon.RibbonButton btnAddMyAddIn;
        internal Microsoft.Office.Tools.Ribbon.RibbonButton btnViewInMyAddIn;
        internal Microsoft.Office.Tools.Ribbon.RibbonButton btnRemoveFromMyAddIn;
        internal Microsoft.Office.Tools.Ribbon.RibbonButton btnSettings;
        internal SettingsForm settingsForm;
    }

    partial class ThisRibbonCollection
    {
        internal MyAddIn MyAddIn
        {
            get { return this.GetRibbon<MyAddIn>(); }
        }
    }
}
vsto outlook-addin ribbon
1个回答
0
投票

我有点愚蠢。RibbonType只是对启用外接程序可见的区域的粗略预选。要精确定义添加功能区的区域,您还需要定义您选项卡的OfficeId如下:this.tab1.ControlId.OfficeId =“ TabAppointment”;从上面的示例代码中,您看到将其设置为TabAppointment。

要找到其他有效的标签,您可能会发现以下list有用

由此我得出结论:如果要在多个窗口(例如主窗口,日历和约会)中显示自定义功能区,则希望将多个功能区附加到各个OfficeId。

© www.soinside.com 2019 - 2024. All rights reserved.