【发布时间】:2019-08-05 07:09:31
【问题描述】:
我创建了一个 Outlook 加载项,它按预期工作。新安装的加载项显示在 Outlook 的“主页”选项卡中。它显示为一个新组。
我需要我的加载项显示在 Outlook 中的新项目选项旁边。
为了更好地理解,请查看图片。我需要在黄色位置添加确切的内容。
代码sn-p
private void InitializeComponent() {
this.tabCustomHome = this.Factory.CreateRibbonTab();
this.group1 = this.Factory.CreateRibbonGroup();
this.menuButton1 = this.Factory.CreateRibbonMenu();
this.btnLogin = this.Factory.CreateRibbonButton();
this.btnLogout = this.Factory.CreateRibbonButton();
this.tabCustomHome.SuspendLayout();
this.group1.SuspendLayout();
this.SuspendLayout();
//
// tabCustomHome
//
this.tabCustomHome.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office;
this.tabCustomHome.ControlId.OfficeId = "TabMail";
this.tabCustomHome.Groups.Add(this.group1);
this.tabCustomHome.Label = "TabMail";
this.tabCustomHome.Name = "tabCustomHome";
//
// group1
//
this.group1.Items.Add(this.menuButton1);
this.group1.Label = "Sample";
this.group1.Name = "group1";
//
// menuButton1
//
this.menuButton1.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
this.menuButton1.Dynamic = true;
this.menuButton1.Image = global::SHOutlookLogin.Properties.Resources.Sales;
this.menuButton1.Label = " ";
this.menuButton1.Name = "menuButton1";
this.menuButton1.ShowImage = true;
//
// btnLogin
//
this.btnLogin.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
this.btnLogin.Label = "Login";
this.btnLogin.Name = "btnLogin";
this.btnLogin.ShowImage = true;
this.btnLogin.Click += BtnLogin_Click;
//
// btnLogout
//
this.btnLogout.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
this.btnLogout.Label = "Logout";
this.btnLogout.Name = "btnLogout";
this.btnLogout.ShowImage = true;
this.btnLogout.Click += BtnLogout_Click;
//
// OutlookLoginRibbon
//
this.Name = "OutlookLoginRibbon";
this.RibbonType = "Microsoft.Outlook.Explorer";
this.Tabs.Add(this.tabCustomHome);
this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.OutlookLoginRibbon_Load);
this.tabCustomHome.ResumeLayout(false);
this.tabCustomHome.PerformLayout();
this.group1.ResumeLayout(false);
this.group1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
internal Microsoft.Office.Tools.Ribbon.RibbonTab tabCustomHome;
internal Microsoft.Office.Tools.Ribbon.RibbonGroup group1;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnLogin;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnLogout;
internal Microsoft.Office.Tools.Ribbon.RibbonMenu menuButton1;
【问题讨论】:
标签: outlook outlook-addin outlook-2016