Adding A Custom Icon to Outlook AddIn’s Context Menu Using C#

This post is continuing the previous outlook addin post (

1. To create a custom mini icon on the left of the context menu, add the following to MyRibbon.cs.

 public Bitmap LoadImage(string imageName)
            Assembly assembly = Assembly.GetExecutingAssembly();
            Stream stream = assembly.GetManifestResourceStream("MyAssemblyName." + imageName);

            return new Bitmap(stream);

2. Then, add the image  resources to the project as an embedded resources.


3. Modify the button definition in Explorer.xml to include the icon:

<button id="btnId" image="img.png"

Bonus Tip : You can also use MS’s default icons. In this case, you don’t need to do step (1) or (2) and add the following line to the Explorer.xml instead:

<button id="btnId" imageMso="HappySmile"

You can find the list of mso ids from this site : .


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: