Custom icon for a macro in Outlook 2010

I've created various macros in Outlook 2010 using VBA.

I've added the ability to execute these macros from the Ribbon by customising the Ribbon to add a new tab, new group and finally new buttons that execute the macros.

Outlook's built-in icons are ok, but I would prefer to use custom-made icons, perhaps created using some other icon graphics program.

Does anyone know of a straightforward way to do this? I'm a java developer so I'm not too familiar with Microsoft's inner workings.

Many thanks for any help.
amrshalabyAsked:
Who is Participating?
 
regmigrantCommented:
I wouldn't like to say its impossible - there are people on here who have achieved things even MS didn't think of - but when doing my own investigation for a different project everyone pointed my at the available office customisation suites and Visual Studio (free) - apart from another learning curve.
0
 
regmigrantCommented:
The basic principle is to load the custom image using xml:-
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
  loadImage="GetImage">
<!-- other stuff -->
   <button id="mycode" image="myimg.jpg" />

However the size, type, grouping, callbacks, etc may vary according to how your current customisations are constructed - especially if you are using Com Addins.

Microsoft has a series of developer resources here:-
http://msdn.microsoft.com/en-us/library/aa338202.aspx

and there's an open source UI editing tool at
http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2009/08/07/7293.aspx
0
 
amrshalabyAuthor Commented:
Thank you regmigrant. Sorry about the delay getting back to you.

Would you be able to provide a step by step process to get this to work? I would investigate the links you've provided however I've got a baby on the way and am a bit time-poor.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
regmigrantCommented:
Been there and understand the problem but without knowing what you are trying to achieve and how what you've already done there's really not a lot more I can add other then the XML strings above, The MS develop guide discusses how those strings work and the UI editing tool would need your code loaded to allow any changes.
0
 
amrshalabyAuthor Commented:
Apologies regmigrant, my bad. I'm a java programmer so microsoft is a bit alien to me (besides a few VBA macros painfully put together).

This isn't an add-in. It's a macro put together by going into Outlook 2010's Developer tab and typing in some VBA code into a stored procedure.

If you then right-click on the Ribbon and select "Customise Ribbon", that allows you add a custom button to the Ribbon (perhaps in a new tab and new group) so that you can call this macro. However you are limited as to the icons you can use - basically the internal stock icons.

My question was whether Microsoft Outlook 2010 allows you to customise the Ribbon further by either:

1. Importing a new icon into their stock collection. In that case you can pick that new icon when customising the Ribbon to add to that new button that calls your macro.
2. Importing a new icon in some other way, and assigning it to the new button.
0
 
regmigrantCommented:
This is not available from the Office UI - You can only choose from the built in images by design (MS wanted to maintain a consistent user experience).

However you can add custom images to the list or use images from disk - the simplest way to do this is to download a custom UI editor as linked above.

the way it works (simplified):-

Non-binary Excel files are stored as Zip archives and named XLM, XLS  etc. To modify the ribbon you open one of these archives and put your changes into xml stream you will find there called customUI. You can add your own pictures from disk or add them into the file itself - which makes it easier to keep your customisations. To make it work you also need VBA code to process the custom image - (this element is handled for you with the internal images).

Rather than try and coach you - its not complicated but its very easy to screw up if you aren't a XML expert (which definitely includes me) - I will point you at a web site that has example code and explanations.
http://www.rondebruin.nl/win/s2/win009.htm

Download the examples and see how they are manipulating the custom images in three different ways, they recommend the Custom UI route but also cover the modification of the XLSM 'archive'  and include all the code necessary to make it work.

Remember that to view what they are doing you most open the XLSM file with an archive program (I use 7zip) and it will reveal the internal structure mentioned in the article

Outlook is more complicated because it doesn't have the archive container so and add-in or the use of Visual Studio is needed to achieve the same goal.
0
 
amrshalabyAuthor Commented:
Thank you regmigrant, that's a nice and easy explanation on your part of how you can add custom icons to Excel and very informative.

It does appear that adding custom images to Excel is relatively straightforward (or not, depending on your views!) but in any case definitely doable by following your instructions above.

As Outlook doesn't have an archive container like Excel, you mentioned that either "an add-in or the use of Visual Studio is needed to achieve the same goal".

I take it then that what I'm trying to do is impossible unless I use Visual Studio?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.