Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Tagged as

How To: Use Standard Office Icons in Your VSTO Solution

, 19 Mar 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
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.1) Create a simple Office AddIn project. This example is using Excel AddIn, but the approach is absolutely the same on Word, Po

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.

  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. image

  3. Add new item – Ribbon control.
  4. image

  5. Add several buttons where we want to apply standard Office icons.
  6. image

  7. Go to button’s properties and find the “OfficeImageId” property.
  8. image

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

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

    Goto: 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.

    Goto: 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.

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

    image

  9. Go back to your solution and fill up all desired button with standard office images and enjoy the result:
  10. image

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)

Share

About the Author

bovykinmaxim

United States United States
No Biography provided

Comments and Discussions

 
QuestionLinux Solution PinmemberBubesh877-Mar-12 22:37 
AnswerRe: Linux Solution Pinmemberbovykinmaxim19-Mar-12 8:33 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.1411022.1 | Last Updated 19 Mar 2012
Article Copyright 2012 by bovykinmaxim
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid