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
Code:'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




Reply With Quote

Bookmarks