我正在运行 2016 独立 Excel(32 位版本)。我一直在构建自定义功能区,到目前为止一切都很好。文档非常流畅且写得很好。但是,我找不到任何方法来包含菜单“部分标题”,如下所示:
具体参考图片中的部分标题(即“单元格大小”、“可见性”等)。我已经看到其他加载项模拟了这一点,除非它们是 COM 加载项。这是我参考的文档:https ://msdn.microsoft.com/en-us/library/dd911038(v=office.12).aspx
是不是已经过时了?我尝试将“带标题的菜单”添加到我的项目中,但这甚至不起作用。我也尝试过添加<labelControl />
,当 labelControl 位于菜单中时,功能区甚至不会加载。
此外,我的 Excel 版本甚至不会显示,<dialogBoxLauncher>
所以我担心有些东西与我的 Excel 版本不兼容。我很容易遵循文档,其他一切都很好。我什editBox
至在我使用的功能区中有一个,并且没有遇到任何 91 错误。所以我知道这不是我。
任何人都可以使用提供的 API 复制它吗?我的功能区是用 XML 构建的,所以我尽可能地减少了错误的可能性,这是我的问题吗?是否应该有专门为章节标题实现的运行时代码?
我的设置的简短片段
<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 && Reopen" onAction="RunMacro" imageMso="SourceControlCheckIn" size="large" screentip="Saves Document, Closes && 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>