我在理解Outlook術語(CommandBarPopup,CommandBarButton等)方面遇到了一些麻煩,因此請耐心等待。在C#中的Outlook插件 - 如何添加新郵件中的按鈕/組(0123簽名旁)
我想創建幾件事情:
我想創建新組(或只是按鈕,但我讀這是不可能的按鈕添加到現有組帶)新郵件功能區中的簽名/添加附件旁邊的電子郵件。它必須以與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下添加子所以當我按下它新的子菜單打開。我如何實現這一目標?
你有關於如何隱藏按鈕組,並添加自己的(我不知道如何創建GRP和那些按鈕)的例子。 – MadBoy 2010-03-09 08:16:31
已經添加了一些功能區xml讓你隱藏標準組並自行修復。 – 76mel 2010-03-09 14:06:19
謝謝,雖然我會慷慨地花了一些時間,直到我得到它的工作;)我真的需要閱讀一些關於它的書籍:) – MadBoy 2010-03-09 20:07:09