none
how to add icons to addin buttons RRS feed

  • Question

  • i am developing an addin for microsoft word.I have installed addin buttons using the following code.

    <style type="text/css">#toc, .toc, .mw-warning { border: 1px solid rgb(170, 170, 170); background-color: rgb(249, 249, 249); padding: 5px; font-size: 95%; }#toc h2, .toc h2 { display: inline; border: medium none; padding: 0pt; font-size: 100%; font-weight: bold; }#toc #toctitle, .toc #toctitle, #toc .toctitle, .toc .toctitle { text-align: center; }#toc ul, .toc ul { list-style-type: none; list-style-image: none; margin-left: 0pt; padding-left: 0pt; text-align: left; }#toc ul ul, .toc ul ul { margin: 0pt 0pt 0pt 2em; }#toc .toctoggle, .toc .toctoggle { font-size: 94%; }body { font-family: 'Liberation Serif'; font-variant: normal; text-indent: 0in; widows: 2; font-style: normal; font-weight: normal; text-decoration: none; color: rgb(0, 0, 0); text-align: left; font-size: 12pt; }table { }td { border-collapse: collapse; text-align: left; vertical-align: top; }p, h1, h2, h3, li { color: rgb(0, 0, 0); font-family: 'Liberation Serif'; font-size: 12pt; text-align: left; }</style>

       private Office.CommandBarButton InstallButtons(Office.CommandBar oStandardBar, string label)

           {

               // In case the button was not deleted, use the exiting one.

               Office.CommandBarButton MyButton;

               try

               {

                   MyButton = (Office.CommandBarButton)oStandardBar.Controls[label];

               }

               catch (Exception)

               {

                   MyButton = (Office.CommandBarButton)oStandardBar.Controls.Add(1, MISSING, MISSING, MISSING, MISSING);

                   MyButton.Caption = label;

                   MyButton.Style = Office.MsoButtonStyle.msoButtonCaption;

                   MyButton.Visible = true;

               }

               return MyButton;

           }

    i want to add icons to the addin buttons. How to add the icons,Can anybody help me to resolve this

    Wednesday, February 29, 2012 5:43 AM

All replies