Reputation: 5056
I tried to add the following custom ribbon (Designer Approach) to the TabHomeGroup in Outlook (Explorer). Unfortunateyl it won't show up. Why?
I used these OfficeIds: https://www.microsoft.com/en-us/download/details.aspx?id=50745
namespace OutlookAddIn4
{
partial class Ribbon_Explorer : Microsoft.Office.Tools.Ribbon.RibbonBase
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
public Ribbon_Explorer()
: 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 die 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.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 = "TabHomeGroup";
this.tab1.Groups.Add(this.group1);
this.tab1.Label = "TabHomeGroup";
this.tab1.Name = "tab1";
//
// group1
//
this.group1.Items.Add(this.btnSettings);
this.group1.Label = "group1";
this.group1.Name = "group1";
//
// 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.btnSettings_Click);
//
// Ribbon_Explorer
//
this.Name = "Ribbon_Explorer";
this.RibbonType = "Microsoft.Outlook.Explorer";
this.Tabs.Add(this.tab1);
this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.Ribbon_Explorer_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 btnSettings;
internal SettingsForm settingsForm;
}
partial class ThisRibbonCollection
{
internal Ribbon_Explorer Ribbon_Explorer
{
get { return this.GetRibbon<Ribbon_Explorer>(); }
}
}
}
Upvotes: 0
Views: 647
Reputation: 49395
Are you sure the TabHomeGroup
is visible at the moment your add-in is started?
Anyway, you need to use the TabHome
idMso instead if you want to place your custom UI on the Home
tab in the Explorer window.
Upvotes: 1