这可能是一个重复的问题, 但我无法让这个函数正常工作。使用那个答案中找到的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秒钟,也不会出现任何提示。我还没有成功地让提示出现。 以下是翻译的内容:
下面是屏幕截图:选项窗口,指示已启用“显示函数屏幕提示”功能。注意:没有其他(内置的)函数显示屏幕提示!有人能向我展示一下屏幕提示应该是什么样子吗?如果我的客户端设置已启用它们,但没有出现任何问题,可能是什么原因导致的?
供参考,可以在这里找到 Custom UI 编辑器按钮的 MSDN 文档 链接。