I want to create custom icons for my macros

I have created 7 macros that I would like to create custom "buttons" for on the QAT.

I have ready Greg Maxey's posts several times and they do not really address my issue.

How do I create a custom button and associate that with a Macro?

I have png files of the icons I want to use.

When I try to use the Custom UI Editor, after I have opened the file,  I don't see any scripts to associate the image with.

Thanks for your help.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

Greg has two pages on his site that deal with this.


http://gregmaxey.mvps.org/word_tip_pages/customize_ribbon_main.html describes the use of the Custom UI Editor. The items on the Insert menu of the editor supply the framework of the XML code, and Greg's article describes a number of variations for the code you can add to it.

If you create a button clause in the XML, for example, you can specify the name of the macro that the button runs by including the OnAction parameter.

http://gregmaxey.mvps.org/word_tip_pages/ribbon_custom_icons.html describes creating custom icons and using the Insert Icon button in the Custom UI Editor to embed the icon's file in the document or template.

_____________________________
https://jay-freedman.info

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Is this one of Greg's posts that didn't help?

http://gregmaxey.mvps.org/word_tip_pages/ribbon_custom_icons.html

The Custom UI Editor doesn't provide scripts, merely a way of accessing the area of the file so you can edit it. You will need to type the content as per Greg's guidance.

Andrew Lockton
Melbourne Australia

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thank you for your responses. I have gone through Greg's articles again.

I have added the images to the file using the Custom UI Editor. They still are not associated with the Macros I have created. And I don't see how to do it. I have followed his step-by-step instructions and still won't show the correct image for my Macro on the QAT. I have 7 to do, I thought I would get one working correctly then do the others.

My macro is titled: ZAFUL.

This is the XML that I have typed:

<customUI

xmlns="http://schemas.microsoft.com/office/2009/07/customui">

<ribbon>

<tabs>

<tab id="ZAFUL" label="UpperLeft" visible="false" >

<group id="customGroup" label="EI Proposal Macros"><button id="UL" label="UpperLeft" image="UL" onAction="RBX.ButtonOnAction" />

</group>

</tab>

</tabs>

</ribbon>

</customUI>

Any help would be appreciated.

Thanks

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

First, where you wrote "My macro is titled: ZAFUL", I hope that means your macro starts with the line

   Sub ZAFUL()

In order to run that macro from a ribbon button or a Quick Access Toolbar button, you have to add an argument between the parentheses, as follows:

    Sub ZAFUL(ByVal control As IRibbonControl)

Your macro doesn't have to use that argument for anything, but it must be there or you'll get an error message instead of running the macro.

Second, I'll admit it isn't very clear in Greg's article about which things in the code he shows can be changed and which things have to stay unchanged. Here's XML that works, as I've verified:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <ribbon startFromScratch="false">
        <tabs>
            <tab id="customTab" label="Custom Tab" visible="false">
                <group id="customGroup" label="Custom Group">
                    <button id="customButton" label="Upper Left" image="UL" onAction="ZAFUL" />
                </group>
            </tab>
        </tabs>
    </ribbon>
</customUI>

The items in the <tab> and <group> tags can have any valid value that isn't in use for something else; the actual values don't matter because the tab is going to stay invisible. Similarly, the id and label values in the <button> tag can be anything. The image value must be equal to the name of the icon that you insert in the Custom UI Editor, and you had that correctly. The OnAction value must be the name of the macro that will be executed when the button is clicked. This last item is the reason your button isn't working.

In Greg's code, the OnAction value "RBX.ButtonOnAction" contains the name of the macro he was using (ButtonOnAction) preceded by the name of the module that contains the macro (RBX), separated by a dot. Including the module name is optional unless there are two or more macros with the same name but in different modules.

_____________________________
https://jay-freedman.info

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thank you, Jay. This still doesn't work. I still don't see my images for the buttons.

I think I will give up on trying to show them in the QAT; it would be the most efficient way to work but, after all the research, I understand I can't save the QAT in template any way.

Many places suggested setting up the macros and toolbars in 2003 and then saving as a dotm so you can use them with 2010. I do not have access to 2003 but I do have accessto 2011 on a Mac. I set up the button images I wanted and added them to a custom toolbar. Today when I open the file in 2010 I see the added tab, I see the tool bar but none of the button images show. The button images are the same PNG files I have been trying to use for the QAT.

All the macros work and if I click on the toolbar where the button image should be, it runs the macro. What do I need to do to see the buttons?

I don't know why Microsoft won't let the user customize their buttons. It used to be simple and easy; now it is a nightmare.

Thanks

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

It can be done.

The images can either be stored in the document data store (as with the skull and light) or from and external file as with the eyeball.

You basically have to create the controls on a custom ribbon tab, then add them to the QAT (Select on ribbon and choose save to QAT), then hide the tab (optional).

Greg Maxey
***
Death smiles at us all, but all a man can do is smile back.


For more help with Word visit:
http://gregmaxey.com/word_tips.html

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

It can be done.

The images can either be stored in the document data store (as with the skull and light) or from and external file as with the eyeball.

You basically have to create the controls on a custom ribbon tab, then add them to the QAT (Select on ribbon and choose save to QAT), then hide the tab (optional).

I was going to ask but discovered that if you give the tab's visible attribute of visible a value of false, the QAT button is still there and still works. If you delete the tab from the XML, the QAT entry disappears as well.

One other note, I would probably use the Customize the Quick Access Toolbar option rather than the Add to Quick Access Toolbar option from the right-click on the ribbon button. That way you can save the QAT customization to the template that contains the Ribbon modification. (That template must be actually open rather than just loaded to do this.)

To be used on a single computer this doesn't much matter, but it doesn't hurt. If you are trying to share the customization, it makes it much nicer.

Conceivably, you could prepare a custom ribbon tab just to hold your images for the QAT, move them to the QAT in that template, then make the ribbon tab itself not accessible.

Volunteering to "pay forward" the help I've received in the Microsoft user community.


Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

Legal site: https://addbalance.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

... after all the research, I understand I can't save the QAT in template any way.

You can save QAT modifications in any template and if the template is loaded as a Global Template they will be available to all documents. This can be done without going into the XML at all, through the Word's interface. Modifying the QAT and Ribbon in Microsoft Word

Custom images or icons is a different matter, though. I am currently working my way through Greg's page on that: Modify QAT\Ribbon Button Images\Labels

After reading that, I tried modifying the tooltip for a macro in a global template. It works! see that I can modify the labels (tooltip text) on macros in the QAT when those macros are put there using the Word interface.

Volunteering to "pay forward" the help I've received in the Microsoft user community.


Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

Legal site: https://addbalance.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Charles,

Will be interested to know if you add the image attribute (vice imageMso) to the QAT customization XML and define an image that is available in the CustomUI images folder in the data store if it will work.  I've never tried and don't have time to do it now.  If so, however, I'll find time to add it to the page.

Greg Maxey
***
Death smiles at us all, but all a man can do is smile back.


For more help with Word visit:
http://gregmaxey.com/word_tips.html

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Steps for making the modification to the QAT tooltip text.

  1. Modify the QAT saving your modifications in the template that holds your macros.
  2. Close Word.
  3. Find the template and rename the extension from .dotm to .zip. (You may want to use a copy.)
  4. Double click on the zip file to open it.
  5. Find the folder userCustomization and open that
  6. You will find the file CustomUI.xml there.
  7. Copy that to any Windows folder (I used my desktop).
  8. If you have an XML editor, use that; I simply changed the extension to .txt and used Notebook.
  9. Open the file to edit it.
  10. To change the tooltips displayed, change the labels for the controls to read what you want.
  11. If you want to use built-in icons, you can change the icon. You'll need to know the name.
  12. Save the file. If you changed the extension to .txt, change it back to .xml.
  13. Cut the file from that location and paste it back in the zip file, overwriting the existing one.
  14. Close the Zip file and rename it with a .dotm extension.

It is very quick. (Thank you Greg!)

(added after Greg's response) Or...

Just use the Modify button in the interface!  :)

Volunteering to "pay forward" the help I've received in the Microsoft user community.


Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

Legal site: https://addbalance.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

 
 

Question Info


Last updated March 9, 2024 Views 8,266 Applies to: