OUTLOOK: How to change programmatically size and icon of a button and menubar? RRS feed

  • Question

  • Hello,

    Does anyone know how to change programmatically button icon and menubar icon?

    At the beginning, I used xml and added image using idMso, like idMso = MoveToFolder...

    how to get those image without using xml?

    this is how I created my button:

     menuBar = this.Application.ActiveExplorer().CommandBars.ActiveMenuBar;                
     newMenuBar = (Office.CommandBarPopup)menuBar.Controls.Add(Office.MsoControlType.msoControlPopup, missing, missing, missing, false);

    newMenuBar.Caption = "test";                         
                                buttonOne = (Office.CommandBarButton)newMenuBar.Controls.Add(Office.MsoControlType.msoControlButton, missing, missing, 1, true);
                                buttonOne.Style = Office.MsoButtonStyle.msoButtonIconAndCaption;
                                buttonOne.Caption = ButtonName;
                                buttonOne.Tag = ButtonDispatch+","+ButtonDueDate;
                                buttonOne.Click += new Office._CommandBarButtonEvents_ClickEventHandler(test.OnClick);
                                newMenuBar.Visible = true;

    thanks in advance

    Wednesday, October 2, 2013 11:05 AM