Excel自定义RibbonUI; 为菜单添加部分标题

我正在运行2016独立Excel(32位版本)。 我一直在build立一个自定义的function区,到目前为止这么好。 这个文档相当stream畅,写得很好。 但是,我不能find任何方式来包含菜单“节标题”,如下所示:

在这里输入图像说明

具体引用图片中的部分标题(即“单元格大小”,“可见性”等)。 我已经看到其他加载项模拟这个,除非他们是COM加载项。 这里是我参考的文档: https : //msdn.microsoft.com/en-us/library/dd911038(v=office.12).aspx

它过时了吗? 我尝试添加“标题菜单”到我的项目,但是,甚至不工作。 我也尝试添加<labelControl /> ,并且当labelControl在Menu中时,function区甚至不会加载。

此外,我的Excel版本甚至不会显示<dialogBoxLauncher>所以我担心有些事情与我的Excel版本不兼容。 我很容易地跟随文档,一切都工作得很好。 我甚至在我使用的function区中有一个编辑editBox ,不会遇到任何91错误。 所以我知道这不是我。

任何人都可以用提供的API复制这个吗? 我的function区是用XML构build的,所以我减less了尽可能多的错误,是我的问题? 是否应该为段落标题专门实施运行时代码?


我的设置短片

 <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnRibbonLoad"> <ribbon> <tabs> <tab idMso="TabHome"> <group id="GroupTextTools" insertAfterMso="GroupFont" label="Text Tools"> <gallery id="textcase_gallery" label="Case Select" columns="1" size="large" imageMso="WordArtInsertDialogClassic" onAction="TextCase_SwitchCase" > <item id="textcase_CapsButton" imageMso="TextAllCaps" label="Uppercase" screentip="Changes selected cells to all uppercase" /> <item id="textcase_ProperButton" label="Propercase" imageMso="ChangeCaseDialogClassic" screentip="Changes selected cells to proper case" /> <item id="textcase_LowerButton" label="Lowercase" imageMso="FontSizeDecrease" screentip="Changes selected cells to all small case" /> </gallery> </group> </tab> <tab id="CustomTab" label="*removed*" insertAfterMso= "TabDeveloper"> <!-- GROUP A --> <group id="GroupFileOptions" label="File Options"> <button id="fileoptions_CloseButton" label="Close &amp;&amp; Reopen" onAction="RunMacro" imageMso="SourceControlCheckIn" size="large" screentip="Saves Document, Closes &amp;&amp; Reopens immediately"/> <menu id="exportingmenu" label="Exporting" imageMso="FileCheckOut" size="large" screentip="Exporting Options"> <menu id="exportmenu_AsRange" label="As Range"> <!-- This is where I would like section Titles to be instead of another menu --> <button id="exportmenu_range_CSVCButton" label="To CSV w/commas"/> <button id="exportmenu_range_CSVSButton" label="To CSV w/spaces"/> <button id="exportmenu_range_PDF" label="To PDF"/> </menu> <menu id="exportmenu_AsSheet" label="As Sheet"> <!--Goal is for this to be a section title, where I tried putting a <labelControl> --> </menu> </menu> </group> <!-- .... --> </tab> </tabs> </ribbon> </customUI> 

经过一些试验和错误,并通过解决我的错误,不由自主地推动了David Zemens ,我发现通过交叉引用所有我用父元素尝试过的东西,唯一使逻辑编译有意义的是<menuSeparator> ,只是碰巧有一个'标题'属性。 所以通过设置你得到一个美丽的章节标题如下所示:

在这里输入图像说明

 <menuSeparator id="someID" title="Test title"/>