【发布时间】:2018-07-31 18:31:08
【问题描述】:
This may be a duplicate,但我无法让此功能正常工作。使用该答案中找到的 XML。
如何将自定义工具提示添加到 Excel 功能区?我用的是Custom UI Editor for Microsoft Office,我的代码如下:
<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="Imports the data from an open workbook" 标签。其余按钮只有 supertip 标签。我也试过 only 包括 screentip 标签,但没有成功。
此功能应该显示菜单项的悬停工具提示,对吗?为什么没有发生这种情况?
我正在使用 Microsoft Office Professional Plus 2013。
下面的屏幕截图:有问题的自定义功能区选项卡。虽然我的屏幕截图程序没有捕获光标,但第一个菜单项当前位于光标下方。即使等待 10 秒,也不会出现这样的工具提示。我还不能成功地显示一个工具提示。
截图如下:选项窗口,显示功能ScreenTips已经启用。注意:也没有其他(内置)函数显示屏幕提示!有人可以告诉我屏幕提示应该是什么样的吗?如果我的客户端设置启用了它们,但没有出现,问题可能是什么原因?
作为参考,自定义 UI 编辑器按钮的 MSDN 文档位于 here。
【问题讨论】:
-
过去,屏幕提示和超级提示都对我有用。使用自定义 UI 编辑器时要记住的一件事(我认为 - 已经有一段时间了,我正在记忆中)是在自定义 UI 编辑器中打开它之前,您需要完全关闭 PPT 中的文件,那么您必须先保存并关闭自定义 UI,然后才能在 PowerPoint 中重新打开它。
-
@DavidZemens 谢谢,但我在整个开发过程中一直遵循这种做法。我也尝试过完全重启,看看是否有任何影响。没有这样的运气。 (稍微修正一下,我用的是Excel)
-
啊好的。是的,我脑子里有 PPT,因为那是我开发的东西,并且正在查看我的一些旧 XML。虽然在 Excel/Word/PPT 中的想法相同 :) 这是 Screentip + Supertip 的屏幕截图,请原谅“supertipe”中的错字imgur.com/a/HD2MSfR
标签: xml vba excel user-interface