我在理解 Outlook 术语(CommandBarPopup、CommandBarButton 等)时遇到了一些问题,比如 Outlook 中的内容,所以请耐心等待。
我想创造几件事:
我想在消息功能区中的签名/添加附件旁边的新邮件上创建新组(或只是按钮,但我读到无法将按钮添加到功能区中的现有组)。它必须以与 Signature 相同的方式工作,因此当您按下它时,它会显示几个选项。我怎样才能创建它?
我想覆盖一个按钮“NEW”(您可以在其中选择要发送新邮件、预约或做其他事情),这样当您在主窗口中按下新按钮旁边的向下箭头时,您可以选择我要添加的选项之一?这可能吗?我该怎么做?
我有一些在主窗口中添加菜单的代码
private void AddMenuBar() { try { //Define the existent Menu Bar menuBar = this.Application.ActiveExplorer().CommandBars.ActiveMenuBar; //Define the new Menu Bar into the old menu bar newMenuBar = (Office.CommandBarPopup) menuBar.Controls.Add(Office.MsoControlType.msoControlPopup, missing, missing, missing, false); //If I dont find the newMenuBar, I add it if (newMenuBar != null) { newMenuBar.Caption = "Test"; newMenuBar.Tag = menuTag; buttonOne = (Office.CommandBarButton) newMenuBar.Controls.Add(Office.MsoControlType.msoControlButton, missing, missing, 1, true); buttonOne.Style = Office.MsoButtonStyle.msoButtonIconAndCaption; buttonOne.Caption = "Test Button"; //This is the Icon near the Text buttonOne.FaceId = 610; buttonOne.Tag = "c123"; //Insert Here the Button1.Click event buttonOne.Click += new Office._CommandBarButtonEvents_ClickEventHandler(ButtonOneClick); newMenuBar.Visible = true; } } catch (Exception ex) { //This MessageBox is visible if there is an error System.Windows.Forms.MessageBox.Show("Error: " + ex.Message.ToString(), "Error Message Box", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
我想在 buttonOne 下添加子菜单,所以当我按下它时会打开新的子菜单。我该如何做到这一点?