如何在 Word 自定义 xml 功能区菜单中显示键盘提示?
How to show keytip in Word custom xml ribbon menu?
我在 Word 中构建了自定义功能区。自定义选项卡和选项卡中一级按钮的按键提示都可以。
我想要菜单按钮上的按键提示。我一直在寻找答案。
这是我的 xml:
<?xml version="1.0" encoding="utf-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="customTab" label="Plain English" keytip="X" >
<group id="Interface" label="Interface with Excel" >
<menu id="Menu1" label="Copy Exercises" size="large" imageMso="Paste" keytip="E" >
<button id="Btn1" label="Dict1" imageMso="OutlineDemote" onAction="pasteDictation1" keytip="D1" />
<button id="Btn2" label="Dict2" imageMso="OutlineDemote" onAction="pasteDictation2" keytip="D2" />
<button id="Btn3" label="Voice" imageMso="OutlineDemote" onAction="pasteVoice" keytip="V" />
<button id="Btn4" label="FITB" imageMso="OutlineDemote" onAction="pasteFITB" keytip="F1" />
<button id="Btn5" label="FITB2" imageMso="OutlineDemote" onAction="pasteFITB2" keytip="F2" />
<button id="Btn6" label="MATCH" imageMso="OutlineDemote" onAction="pasteMatch" keytip="M" />
</menu >
<menu id="Menu2" label="Build links" size="large" imageMso="EditLinks" keytip="B" >
<button id="build1" label="Find strings" imageMso="FindDialog" onAction="linkHistory1" keytip="F" />
<button id="build2" label="Build links" imageMso="EditLinks" onAction="linkHistory2" keytip="B" />
</menu >
<menu id="Menu3" label="Copy to Excel" size="large" imageMso="CopyToPersonalCalendar" keytip="C" >
<button id="cop1" label="First copy" imageMso="_1" onAction="firstCopy" keytip="1" />
<button id="cop2" label="Second copy" imageMso="_2" onAction="secondCopy" keytip="2" />
</menu >
<button id="jrh" visible="true" size="large"
label="JR Highlights" keytip="H"
onAction="findReplace2"
imageMso="TextHighlightColorPicker"/>
</group>
<group id="Links" label="Links" >
<menu id="Menu4" label="Internal Links" size="large" imageMso="ImportTextFile" keytip="L" >
<button id="il1" label="Lessons" imageMso="OutlineDemote" onAction="linkLessons" keytip="d" />
<!--button id="il2" label="Current Lesson" imageMso="OutlineDemote" onAction="linkCurrentLesson" keytip="b" />
<button id="il3" label="Expressions" imageMso="OutlineDemote" onAction="linkExpressions" keytip="c" />
<button id="il4" label="Current Expression" imageMso="OutlineDemote" onAction="linkCurrentExpression" keytip="d" />
<button id="il5" label="Videos" imageMso="OutlineDemote" onAction="linkVideos" keytip="e" />
<button id="il9" label="Current Video" imageMso="OutlineDemote" onAction="linkCurrentVideo" keytip="f" />
<button id="il6" label="Lingo" imageMso="OutlineDemote" onAction="linkLingo" keytip="g" />
<button id="il7" label="Current Lingo" imageMso="OutlineDemote" onAction="linkCurrentLingo" keytip="h" />
<button id="il8" label="Number" imageMso="OutlineDemote" onAction="linkNumber" keytip="i" /-->
</menu >
<button id="lin2" visible="true" size="large"
label="External Link" keytip="X"
onAction="linkExternal"
imageMso="ExportTextFile"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
以及按钮和菜单的图像:
我模糊地记得按键提示没有用于菜单项,但我无法从我必须提供的文档中确认这一点。但是,如果您查看内置菜单,键提示对应于菜单项的加速键。
基于此,我会尝试向您的菜单项添加快捷键
<button id="cop1" label="&First copy" imageMso="_1" onAction="firstCopy" />
<button id="cop2" label="&Second copy" imageMso="_2" onAction="secondCopy" />
我在 Word 中构建了自定义功能区。自定义选项卡和选项卡中一级按钮的按键提示都可以。
我想要菜单按钮上的按键提示。我一直在寻找答案。
这是我的 xml:
<?xml version="1.0" encoding="utf-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="customTab" label="Plain English" keytip="X" >
<group id="Interface" label="Interface with Excel" >
<menu id="Menu1" label="Copy Exercises" size="large" imageMso="Paste" keytip="E" >
<button id="Btn1" label="Dict1" imageMso="OutlineDemote" onAction="pasteDictation1" keytip="D1" />
<button id="Btn2" label="Dict2" imageMso="OutlineDemote" onAction="pasteDictation2" keytip="D2" />
<button id="Btn3" label="Voice" imageMso="OutlineDemote" onAction="pasteVoice" keytip="V" />
<button id="Btn4" label="FITB" imageMso="OutlineDemote" onAction="pasteFITB" keytip="F1" />
<button id="Btn5" label="FITB2" imageMso="OutlineDemote" onAction="pasteFITB2" keytip="F2" />
<button id="Btn6" label="MATCH" imageMso="OutlineDemote" onAction="pasteMatch" keytip="M" />
</menu >
<menu id="Menu2" label="Build links" size="large" imageMso="EditLinks" keytip="B" >
<button id="build1" label="Find strings" imageMso="FindDialog" onAction="linkHistory1" keytip="F" />
<button id="build2" label="Build links" imageMso="EditLinks" onAction="linkHistory2" keytip="B" />
</menu >
<menu id="Menu3" label="Copy to Excel" size="large" imageMso="CopyToPersonalCalendar" keytip="C" >
<button id="cop1" label="First copy" imageMso="_1" onAction="firstCopy" keytip="1" />
<button id="cop2" label="Second copy" imageMso="_2" onAction="secondCopy" keytip="2" />
</menu >
<button id="jrh" visible="true" size="large"
label="JR Highlights" keytip="H"
onAction="findReplace2"
imageMso="TextHighlightColorPicker"/>
</group>
<group id="Links" label="Links" >
<menu id="Menu4" label="Internal Links" size="large" imageMso="ImportTextFile" keytip="L" >
<button id="il1" label="Lessons" imageMso="OutlineDemote" onAction="linkLessons" keytip="d" />
<!--button id="il2" label="Current Lesson" imageMso="OutlineDemote" onAction="linkCurrentLesson" keytip="b" />
<button id="il3" label="Expressions" imageMso="OutlineDemote" onAction="linkExpressions" keytip="c" />
<button id="il4" label="Current Expression" imageMso="OutlineDemote" onAction="linkCurrentExpression" keytip="d" />
<button id="il5" label="Videos" imageMso="OutlineDemote" onAction="linkVideos" keytip="e" />
<button id="il9" label="Current Video" imageMso="OutlineDemote" onAction="linkCurrentVideo" keytip="f" />
<button id="il6" label="Lingo" imageMso="OutlineDemote" onAction="linkLingo" keytip="g" />
<button id="il7" label="Current Lingo" imageMso="OutlineDemote" onAction="linkCurrentLingo" keytip="h" />
<button id="il8" label="Number" imageMso="OutlineDemote" onAction="linkNumber" keytip="i" /-->
</menu >
<button id="lin2" visible="true" size="large"
label="External Link" keytip="X"
onAction="linkExternal"
imageMso="ExportTextFile"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
以及按钮和菜单的图像:
我模糊地记得按键提示没有用于菜单项,但我无法从我必须提供的文档中确认这一点。但是,如果您查看内置菜单,键提示对应于菜单项的加速键。
基于此,我会尝试向您的菜单项添加快捷键
<button id="cop1" label="&First copy" imageMso="_1" onAction="firstCopy" />
<button id="cop2" label="&Second copy" imageMso="_2" onAction="secondCopy" />