Solved

Custom icon for a macro in Outlook 2010

Posted on 2014-02-16
7
2,372 Views
Last Modified: 2014-03-27
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.
0
Comment
Question by:amrshalaby
  • 4
  • 3
7 Comments
 
LVL 19

Expert Comment

by:regmigrant
ID: 39862526
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
 

Author Comment

by:amrshalaby
ID: 39879123
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
 
LVL 19

Expert Comment

by:regmigrant
ID: 39879230
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:amrshalaby
ID: 39879260
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
 
LVL 19

Expert Comment

by:regmigrant
ID: 39879379
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
 

Author Comment

by:amrshalaby
ID: 39915716
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
 
LVL 19

Accepted Solution

by:
regmigrant earned 500 total points
ID: 39915801
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
export "on my mac" folders to outlook 2016 2 17
MS Excel Formula Help 3 32
Google calendar in MS outlook 3 18
NEED TRANSFER  DATA 59 19
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question