Width of Ribbon Controls

G

Greg Maxey

Posting here for lack of a better place I suppose.

If you look at the built-in Ribbon control "Font" in the "GroupFont" of the
Home tab you will notice that the control field is wide enough to accomodate
all of the font names in the the font list.

If you add this built-in control to a custom tab\group the control appears
much narrower and so many of the font names are cutoff.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="TabNew" label="My Tab">
<group id="Grp1">
<comboBox idMso="Font" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>

If I to add the attribute sizeString to the XML script

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="TabNew" label="My Tab">
<group id="Grp1">
<comboBox idMso="Font" sizeString="XXXXXXXXXXXXXXXXXXXXXXXXXX" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>

Word throws an error when the ribbon XML attempts to load stating "Some
properties of built-in controls can not be modifed "Font"

The ribbon modification then appears and the Font control is still narrow.

If some of the MS technical gurus are browsing this group then I would be
interested to know why the control behaves as it does. If it is so wide in
the GroupFont control then why isn't it that same width when inserted in a
custom control?

Thanks.
 
G

Greg Maxey

How does that make it work?

Adding that line is the script I tried and posted only adds the fontsize
control next to the font control. It has no effect on how wide the Font
control is which is much narrower than the one shown by default in the
builtIn GroupFont.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="TabNew" label="My Tab">
<group id="Grp1">
<comboBox idMso="Font" />
<comboBox idMso="FontSize" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
 
J

Jules

This puts the Font group on a tab - when you look at the dropdown it shows
the Font and Size in the appropriate width - is that not what you are doing?
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">

<ribbon

startFromScratch="false">

<tabs>

<tab id="rxtabFonts"

label="Fonts"

insertBeforeMso="TabHome">

<group id="rxgrpFonts"

label="Fonts">

<comboBox idMso="Font"/>

<comboBox idMso="FontSize"/>

</group>

</tab>

</tabs>

</ribbon>

</customUI>
 
G

Greg Maxey

Jules,

I used your code to produce the ribbon clip shown here:

http://gregmaxey.mvps.org/scratch_pad.htm

It contains the two controls Font and FontSize but the Font control is much
narrower than the same control shown in the builtin Font group and there
doesn't seem to be anyway to make it wider.

I won't be back to this thread again tonight, but do you get different
results from that shown in link above?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top