PDA

View Full Version : Office RibbonX - Large SubMenu Items Within A Dynamic Menu



mahat
01-03-2014, 10:38 PM
Is it possible to get LARGE submenu items within a dynamic menu?
It is possible to create LARGE submenu items within a normal / static menu!
I tried a combination putting a dynamic into a static menu - but this does not do the trick...
Kindly view the attachment to see what I am after...
Any ideas are highly appreciated... :confused:

Excel Fox
01-03-2014, 10:54 PM
Before downloading your sample file, I should ask, did you try using the gallery?

Excel Fox
01-03-2014, 11:13 PM
My other question to you would be, if you are hard-coding your dynamic menu content, then why keep it dynamic anyway? I don't see your code expanding in any way. Or was it just for the example's sake?

The itemSize keyword, as you rightly said, cannot be used as an attribute in the XML. It should actually placed at the same line as the schema definition for the dynamic menu. Basically, your XML should look like this


'Callback getContent for the Dynamic Menu
Sub RDBdynamicMenuContent(control As IRibbonControl, ByRef returnedVal)
Dim xml As String
xml = "<menu xmlns=""http://schemas.microsoft.com/office/2009/07/customui"" itemSize=""large"">" & _
"<menu id=""MyMacroSubMenu"" label=""Macro Sub-Menu"" itemSize=""large"">" & _
"<button id=""Sub1But1"" imageMso=""AppointmentColor1"" label=""Smile"" onAction=""Macro1"" description=""Beschreibung Macro1""/>" & _
"<button id=""Sub1But2"" imageMso=""AppointmentColor2"" label=""Paint"" onAction=""Macro2"" description=""Beschreibung Macro2""/>" & _
"<button id=""Sub1But3"" imageMso=""AppointmentColor3"" label=""Filter"" onAction=""Macro3"" description=""Beschreibung Macro3""/>" & _
"</menu>" & _
"</menu>"

returnedVal = xml

End Sub

'Callback getContent for the Stanamic Menu
Sub RDBdynamicMenuContent2(control As IRibbonControl, ByRef returnedVal)
Dim xml As String
xml = "<menu xmlns=""http://schemas.microsoft.com/office/2009/07/customui"" itemSize=""large"">" & _
"<button id=""Sub1But1"" imageMso=""AppointmentColor1"" label=""Smile"" onAction=""Macro1"" description=""Beschreibung Macro1""/>" & _
"<button id=""Sub1But2"" imageMso=""AppointmentColor2"" label=""Paint"" onAction=""Macro2"" description=""Beschreibung Macro2""/>" & _
"<button id=""Sub1But3"" imageMso=""AppointmentColor3"" label=""Filter"" onAction=""Macro3"" description=""Beschreibung Macro3""/>" & _
"</menu>"

returnedVal = xml

End Sub

mahat
01-03-2014, 11:44 PM
A W E S O M E !%D
Last month I've read the entire RibbonX book, but this didn't help to figure out what I was doing wrong.
THANK YOU for taking the time to look into my example file. I am working on a very complex Add-In. Therefore sometimes it helps to put certain issues in a simple sample file to home in on the problem more easily. What I wasn't able to do - you accomplished! Within my Add-In I used the itemSize command at the position you suggested and S U C C E S S!%D
I must say "Thank you" one more time to express my honest gratitude.%D

excelsamuel
12-19-2014, 08:13 AM
I am getting an error with I import the above ribbon file, is there any way to Turn on error messages for the ribbon UI in Excel 2007 so that I can understand what the error is and then post here for some help?

Excel Fox
12-19-2014, 09:21 AM
I am guessing it's because you got the wrong schema
Replace
http://schemas.microsoft.com/office/2009/07/customui with
http://schemas.microsoft.com/office/2006/01/customui