Changing the height/layout of custom ribbons

piggeh

New Member
Joined
Jul 7, 2010
Messages
11
I have created a custom ribbon in access with only a couple of options within the group, and with small (well, 'normal' sized icons). What I wanted was for this to stretch across the screen, one button at a time. However at the moment they appear like this (excuse the names, smiley wont make the proper release ;)):

ribsc.jpg


Is it possible to get the buttons side by side using these small icons? I don't want the ribbon to take up as much room on the page as it looks a bit ugly having so much blue space to the right of only a couple of buttons!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You do have the option to use large icons, which will force them to take up more space. Alternatively you can put a separator between each menu item.
Did you build the ribbon by hand or using a utility tool?

Denis
 
Upvote 0
I used an online tutorial and then plan to add my own icons (I added the one for print macro), but I only need 2 or 3 icons in total. It's just all the blue space to the right looks very wasteful. Code currently is:
PHP:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false" >
<tabs>
<tab idMso="TabCreate" visible="false" />
<tab id="dbCustomTab" label="Custom Tab" visible="true">
<group id="dbCustomGroup" label="Custom Group">
<button idMso="Paste" imageMso="Paste" label="Built-in Paste" size="normal" enabled="true" />
<button imageMso="HappyFace" size="normal" label="smiley!" idMso="Cut" />
<button id="printPO" onAction="macro" label="print" size="normal" imageMso="Paste" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
 
Last edited:
Upvote 0
The only other thing was I wanted to link to a function rather than a macro but couldnt work out how to reference it. I have a function Command41_Click() and tried to reference as Command41 or Command41_Click but no dice. I've just used a macro for now, it's no biggy but would be good to know how to reference functions correctly.
 
Upvote 0
seperators put one alongside another, but still a lot of empty space. I guess what I really need to do is either be able to specify the height of the ribbon to force it to show them side by side rather than one on top of the other.
 
Upvote 0
You can't specify the height of the ribbon AFAIK -- that's fixed. See what happens if you change size=normal to size=large for the icons.
Also, you can get the Custom UI editor to generate the callback functions for you so you can use VBA instead of macros.
Another option is to take the button click function off the form where it lives, put it into a standard module and make it public.
You can then use the RunCode action in a macro to call the function.

Denis
 
Upvote 0
Thakns Denis, guess I'll make the icons large, will have to do. Thanks for the advice on macro RunCode usage will probably do it that way as looks pretty easy to do without learning about custom UI editors :p
 
Upvote 0
You can use the box element to help formatting the position of controls on the ribbon. Give this a go.

PHP:
Put some controls in here
</BOX>

A box can be either horizontal or vertical so you can force "white space" into the ribbon to spread things out a bit.

 
Last edited:
Upvote 0
Ok, I give up trying to get the XML to show properly, but have a look at the box element anyway!!
 
Upvote 0
Ok, I give up trying to get the XML to show properly, but have a look at the box element anyway!!

It seems to mess up displaying it sometimes, and other times is ok! Will look up the box element, cheers.
 
Upvote 0

Forum statistics

Threads
1,214,638
Messages
6,120,676
Members
448,977
Latest member
moonlight6

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top