dynamic填充excel UIfunction区中的dynamicMenu

我想从工作表中的列表中填充自定义Excelfunction区中的dynamicMenu。 我的XML代码是这样的:

<dynamicMenu id="A" label="Menu A" imageMso="FormatPainter" getContent="GetMenuContent" /> 

我可以看到菜单。 我没有的是GetMenuContentcallback,但是我知道有macros在哪里填充菜单应该正确吗?

解决了! 从这个链接得到答案。

只需将你的getContent指令指向这个macros:

 Sub GetContent(control As IRibbonControl, ByRef returnedVal) Dim xml As String xml = "<menu xmlns=""http://schemas.microsoft.com/office/2009/07/customui"">" & _ "<button id=""but1"" imageMso=""Help"" label=""Help"" onAction=""HelpMacro""/>" & _ "<button id=""but2"" imageMso=""FindDialog"" label=""Find"" onAction=""FindMacro""/>" & _ "</menu>" returnedVal = xml End Sub Sub HelpMacro(control As IRibbonControl) MsgBox "Help macro" End Sub Sub FindMacro(control As IRibbonControl) MsgBox "Find macro" End Sub