Click here to Skip to main content
15,885,546 members
Articles / Programming Languages / C#

How To: Use Standard Office Icons in Your VSTO Solution

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
19 Mar 2012CPOL2 min read 65.2K   577   4   2
This post is about using standard MS Office icons on a custom VSTO Office AddIn.

This post is about using standard MS Office icons on a custom VSTO Office AddIn. This can be achieved by setting up the imageMso property on a Ribbon designer.

image

image

image

image

The only thing that we need now is to get a value for the image id and we are good. There exist several approaches to retrieve these values.

I. Using Microsoft Visual Studio Tools for the Office System Power Tools

Go to: http://www.microsoft.com/download/en/details.aspx?id=7805 and download the “VSTO_PTRibbonIDs.exe”. This will install a plugin for Visual Studio, but only for 2008 and lower (unfortunately).

Open up Visual Studio 2008 and go to Tools –> ImageMso Window:

image

Inside the opened window, just click the icon you want to get the “idMso” property and it will be copied to clipboard, so you can just simply paste it to button’s “OfficeImageId”.

image

II. Using the Macro-enabled Word or Excel Document with the Same Set of Images

Go to: http://www.microsoft.com/download/en/details.aspx?id=21103 and download the “Office2010IconsGallery.docx”.

Open the document and click “Enable Editing”. Then, go to File menu and select of the “ImageMso 0” or “Image Mso 1” menu items.

image

III. Online Gallery

Go to: http://soltechs.net/CustomUI/imageMso01.asp and select one of the 9 galleries (or preview everything).

image

image

  1. Create a simple Office AddIn project. This example is using Excel AddIn, but the approach is absolutely the same on Word, PowerPoint or any other Office AddIn.
  2. Add new item – Ribbon control.
  3. Add several buttons where we want to apply standard Office icons.
  4. Go to button’s properties and find the “OfficeImageId” property.
  5. Go back to your solution and fill up all desired buttons with standard office images and enjoy the result:

As usual, the Visual Studio solution and code files could be found on my public SVN: http://subversion.assembla.com/svn/max-s-blog-posts/ (ImageMsoExcelAddIn project).

Thank you and best regards.
Max B.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionLinux Solution Pin
Bubesh877-Mar-12 21:37
Bubesh877-Mar-12 21:37 
AnswerRe: Linux Solution Pin
bovykinmaxim19-Mar-12 7:33
bovykinmaxim19-Mar-12 7:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.