如何为自定义的Excel功能区界面添加工具提示?

3

这可能是一个重复的问题, 但我无法让这个函数正常工作。使用那个答案中找到的XML。

我如何在Excel功能区中添加自定义工具提示?我正在使用Microsoft Office的自定义UI编辑器,我的代码如下:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
    <tabs>
        <tab id="customTab" label="Quoting Utilities" insertBeforeMso="TabHome">

            <group id="CGImportingFiles" label="Importing Files">
                <button id="ImportOpenWorkbook" label="Import Open Workbook" size="large" imageMso="InfopathExportToExcel" onAction="CGCImportOpenWorkbook" screentip="Title" supertip="Imports the data from an open workbook" />
                <button id="ImportSavedWorkbook" label="Import Saved Workbook" size="large" imageMso="FormExportToExcel" onAction="CGCImportSavedWorkbook" supertip="Imports the data from a saved workbook" />
                <button id="ImportFromClipboard" label="Import From Clipboard" size="large" imageMso="PasteSingleCellTableAsTable" onAction="CGCImportFromClipboard" supertip="Pastes the clipboard contents" />
                <button id="ClearDataTable" label="Clear Data Table" size="large" imageMso="NewTableStyle2" onAction="CGCClearDataTable" supertip="Clears all data within the data table" />
            </group>
            <group id="CGCleaningData" label="Cleaning Data">
                <button id="UnmergeConsolidate" label="Unmerge Selection and Consolidate" size="large" imageMso="CatalogMergeCreateList" onAction="CGCUnmergeConsolidate" supertip="Unmerges all cells within the selection. If doing so would leave any empty rows or columns, delete them" />
                <button id="CropSelection" label="Crop Selection" size="large" imageMso="PageFitToDrawing" onAction="CGCCropSelection" supertip="Deletes all data in the sheet which is outside the current selection. Selection is moved to A1" />
                <button id="RemoveSpecialChars" label="Remove Special Characters" size="large" imageMso="WordCount" onAction="CGCRemoveSpecialChars" supertip="Removes all non-keyboard characters within selection (depends on header datatype)" />
                <button id="RangeAssign" label="Assign Value to Range" size="large" imageMso="EnableInlineEdit" onAction="CGCRangeAssign" supertip="Assign one value to each cell in a range of cells" />
            </group>
            <group id="CGDataCategories" label="Header Functions">
                <button id="ResetColumnHeaders" label="Reset Column Headers" size="large" imageMso="FieldChooser" onAction="CGCResetColumnHeaders" supertip="Clears all header selections" />
                <button id="ClearBlankHeaders" label="Clear Blank Headers" size="large" imageMso="CrossFunctionalFlowchartVerticalDirection" onAction="CGCClearBlankHeaders" supertip="Replaces all blank header selections with actual blanks (a hyphen -> a blank)" />
                <button id="ValidateColumnSelections" label="Validate Column Headers" size="large" imageMso="ReviewRevisionAccept" onAction="CGCValidateColumnSelections" supertip="Check that all required headers exist, that no header is duplicated, that every header has data, and that all data has a header" />
                <button id="SortIntoStandardFormat" label="Sort Columns by Std Order" size="large" imageMso="ArrangeTools" onAction="CGCSortIntoStandardFormat" supertip="Sort data into the standard format, based on headers" />
            </group>
            <group idMso="GroupEnterDataAlignment" />
            <group idMso="GroupEnterDataNumber" />
            <group idMso="GroupClipboard" />
            <group idMso="GroupAlignmentExcel" />
            <group idMso="GroupCells" />                                
            <group idMso="GroupEditingExcel" />
        </tab>
    </tabs>
</ribbon>

请注意,第一个按钮(ImportOpenWorkbook)具有screentip =“Title”和supertip =“从打开的工作簿导入数据”标签。其余的按钮只有supertip标签。我已经尝试过仅包含screentip标签,但没有成功。
这个功能应该显示菜单项的悬停提示,对吧?为什么没有发生呢?
我正在使用Microsoft Office Professional Plus 2013。
下面是截图:问题所在的自定义Ribbon选项卡。虽然我的屏幕截图程序没有捕获到光标,但第一个菜单项当前在光标下方。即使等待10秒钟,也不会出现任何提示。我还没有成功地让提示出现。

Screenshot of Custom Ribbon UI

以下是翻译的内容:

下面是屏幕截图:选项窗口,指示已启用“显示函数屏幕提示”功能。注意:没有其他(内置的)函数显示屏幕提示!有人能向我展示一下屏幕提示应该是什么样子吗?如果我的客户端设置已启用它们,但没有出现任何问题,可能是什么原因导致的?Excel Options ScreenTips Enabled

供参考,可以在这里找到 Custom UI 编辑器按钮的 MSDN 文档 链接


屏幕提示和超级提示在过去对我都有效。使用自定义UI编辑器时需要注意一件事情(我想——已经有一段时间了,我是根据记忆来说的),那就是在打开Custom UI编辑器之前,您需要完全关闭PPT文件,然后保存并关闭Custom UI,最后再重新在PowerPoint中打开它。 - David Zemens
@DavidZemens 谢谢你,但我一直在开发过程中遵循这种做法。我也尝试了完全重新启动以查看是否有任何影响。运气不佳。(稍作更正,我正在使用Excel) - user3943127
1
啊,好的。是的,我之前一直在开发PPT,所以一直想着它,看了一下我以前的XML。不过Excel/Word/PPT都是同样的思路 :) 这是Screentip和Supertip一起的截图,请原谅“supertipe”中的拼写错误 https://imgur.com/a/HD2MSfR - David Zemens
1个回答

3

我已经找到了自己问题的答案!我会为后人分享。

解决方案

问题中关键的信息是:

没有其他(内置)功能也没有显示屏幕提示!

我能够找到第二个屏幕提示设置(为什么有两个不同的意思是“显示屏幕提示”的设置,我可能永远都不知道)。如下所示的截图: 附加设置的截图

以前,屏幕提示样式设置为“不显示屏幕提示”,但应该是“在屏幕提示中显示功能描述”。再次说明,这个设置感觉上与问题中描述的设置重复了,但是根据微软的说法,“功能”和“函数”之间可能存在区别...?如果是这样,这些术语显然很容易混淆。

无论如何,现在屏幕提示(和超级提示)都显示正确了!请参见下面的截图: 更正的设置

反驳问题

为什么微软有两个标题如此相似的设置?

如果您知道这些是两个不同的设置,或许在评论中发表意见可以进一步澄清这个问题,或者帮助理解“功能”和“特性”的含义。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接