Ribbon control Word 2007. Multi line button labels

J

Jason

Hi,

Not sure if this is the right forum?

I have developed a Word addin that inserts images and URL references to
meeting request files. To do this I created a custom ribbon tab for my
application and build a dynamic menu that contains buttons, one for each
meeting request. The version of my tool that works in Office 2003 displays
the meeting request details on multiple lines per menu item in the dropdown
menu (CommandbarButton object).

I'm not able to figure out how, if it's even possbile to create the buttons
on the ribbon where the the label text is on multiple lines something like:

Subject: My Meeting
Date: 06/24/2008
Time: 6:00:00pm PST
--------------------------------
Subject: My Meeting 2
Date: 06/26/2008
Time: 5:00:00pm PST

I can dosingle lines but the label gets bussy and it does not look good. I'd
like to at least make it appear similar to the Office 2003 commandbar menu..

Is this possible?

Thanks
Jason
 
J

Jialiang Ge [MSFT]

Hello Jason,
Not sure if this is the right forum?
Yes. Both microsoft.public.office.developer.automation and
microsoft.public.developer.outlook.addins fit this issue.

Jason, by this time, I have not found out workarounds to set a line break
in the button label of Office 2007 Ribbon UI. This a quick note to let you
know that I am still performing and will get back to you as soon as
possible.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
J

Jialiang Ge [MSFT]

Hello Jason,
Not sure if this is the right forum?
Yes. Both microsoft.public.office.developer.automation and
microsoft.public.developer.outlook.addins fit this issue.

Jason, by this time, I have not found out workarounds to set a line break
in the button label of Office 2007 Ribbon UI. This a quick note to let you
know that I am still performing researches and will get back to you as soon
as possible.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
J

Jialiang Ge [MSFT]

Hello Jason,

Sorry for letting you wait. I'm back with a resolution.

Step1. set the button's ControlSize property to RibbonControlSizeLarge.
(there's no method to set multi-line label if the button's ControlSize is
RibbonControlSizeRegular)

Step2. insert '\n' as line breaks. For example:

this.button1.Label = "AAAA" + "\n" + "BBBB";

Hope it helps

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================


"Jialiang Ge [MSFT]" said:
Hello Jason,
Not sure if this is the right forum?
Yes. Both microsoft.public.office.developer.automation and
microsoft.public.developer.outlook.addins fit this issue.

Jason, by this time, I have not found out workarounds to set a line break
in the button label of Office 2007 Ribbon UI. This a quick note to let you
know that I am still performing researches and will get back to you as
soon
as possible.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no
rights.
=================================================
 
J

Jason

Sorry it's taken me a while to get back to you...had a bunch of other
projects steal my time.

I am using the XML file and dynamically building a menu using XML so I'm not
sure how to grab a reference to my button object and update the label... can
you elaborate a little more on the code you gave me??

Thanks
Jason


Jialiang Ge said:
Hello Jason,

Sorry for letting you wait. I'm back with a resolution.

Step1. set the button's ControlSize property to RibbonControlSizeLarge.
(there's no method to set multi-line label if the button's ControlSize is
RibbonControlSizeRegular)

Step2. insert '\n' as line breaks. For example:

this.button1.Label = "AAAA" + "\n" + "BBBB";

Hope it helps

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================


"Jialiang Ge [MSFT]" said:
Hello Jason,
Not sure if this is the right forum?
Yes. Both microsoft.public.office.developer.automation and
microsoft.public.developer.outlook.addins fit this issue.

Jason, by this time, I have not found out workarounds to set a line break
in the button label of Office 2007 Ribbon UI. This a quick note to let you
know that I am still performing researches and will get back to you as
soon
as possible.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no
rights.
=================================================
 
J

Jialiang Ge [MSFT]

Hello Jason,

I assumed you meant to add ribbons with Ribbon controls in VSTO, so I gave
the code:
this.button1.Label = "AAAA" + "\n" + "BBBB";
where "button1" is a Ribbon button control.

If you are directly operating on Ribbon XML, we can still do it in these
ways:

*Method 1. Have a line break in the label value the Ribbon XML:*

<?xml version="1.0" encoding="UTF-8"?>
<customUI onLoad="Ribbon_Load"
xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab idMso="TabAddIns">
<group id="group2" label="group2">
<button id="button1" label="line1
line2" size="large" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>

Please note that I removed the possible spaces before the second line
"line2"

*Method 2. Write the '\n' character in an XML string:*

return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<customUI onLoad=\"Ribbon_Load\"
xmlns=\"http://schemas.microsoft.com/office/2006/01/customui\">" +
"<ribbon><tabs><tab idMso=\"TabAddIns\"><group id=\"group2\"
label=\"group2\">" +
"<button id=\"button1\" label=\"line1\nline2\" size=\"large\" />" +
"</group></tab></tabs></ribbon></customUI>";

In the label property, I insert a character '\n':
label=\"line1\nline2\"

In the above two method, please also note that I set "size=large" in the
button, which represents the ControlSize property to be
RibbonControlSizeLarge in VSTO. If we do not set this property, the line
break won't take effect in the resulting UI.

Jason, please have a try and let me know whether this solution meets your
needs.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 

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