Hello,
I know this is post is a bit old, but this is the solution I have been looking for! Thanks very much!
I did make mine a bit simpler and chose to create a string in VBA for the XML, and got rid of all the subs that move the string in and out of the shape data. It works very well.
ribbonXML = "<customUI onLoad=""OnRibbonLoad"" xmlns=""
http://schemas.microsoft.com/office/2009/07/customui"">"
ribbonXML = ribbonXML + " <ribbon>"
ribbonXML = ribbonXML + " <tabs>"
ribbonXML = ribbonXML + " <tab id=""Tab1"" label=""Tab1"">"
ribbonXML = ribbonXML + " <group id=""Group1"" label=""Group1"" >"
ribbonXML = ribbonXML + " <button id=""Button1"" label=""Button1"" supertip=""Button1"" size=""large"" imageMso=""MailMergeGoToNextRecord"" onAction=""Button_OnAction""/>"
ribbonXML = ribbonXML + " <button id=""Button2"" label=""Button2"" supertip=""Button2"" size=""large"" imageMso=""SignaturesLoading"" onAction=""Button_OnAction""/>"
ribbonXML = ribbonXML + " </group>"
ribbonXML = ribbonXML + " </tab>"
ribbonXML = ribbonXML + " </tabs>"
ribbonXML = ribbonXML + " </ribbon>"
ribbonXML = ribbonXML + "</customUI>"
However - it seems anytime I try to do something not provided in your example, my ribbon will not load. Here are the three things I tried:
1) adding getVisible=""getVisible"" to the tabs and groups.
2) adding getEnabled=""getEnabled"" to the tabs and groups.
3) adding an editBox
All the above use the standard method (add the action in the ribbon with the callback sub name, add the callback sub) as shown below:
{the gobal variable}
Public objRibbonVisible As Boolean
'
{inside the ribbon string}
ribbonXML = ribbonXML + " <group id=""Group1"" label=""Group1"" getVisible=""GetVisible"">"
{The callback sub}
Public Sub GetVisible(control As IRibbonControl, visible)
visible = objRibbonVisible
objRibbon.Invalidate
End Sub
Is there something I am missing??