在组标签名称中使用“&"符号在Word 2010中开发功能区选项卡 [英] Developing a ribbon tab in Word 2010, using ampersand symbol in group label name
问题描述
我正在开发功能区选项卡,以用于Word 2010的模板(MyTemplate.dotm
).
I'm developing a ribbon tab for use in a template (MyTemplate.dotm
) for Word 2010.
我的问题:我想在一个组的标签中有一个&符号(&).我已经尝试了很多事情,并且在这个问题上进行了大量的搜索,但是没有任何效果:
My problem: I want to have an ampersand symbol (&) in the label for a group. I have tried many things, and also alot of googling about this issue, but nothing works:
(named) &
(decimal) &
(decimal) &
(hex) &
这是我尝试过的,xml保存在MyTemplate.dotm
文件中(使用用于Microsoft Office的自定义UI编辑器):
This is what I have tried, the xml saved in MyTemplate.dotm
-file (with Custom UI Editor for Microsoft Office):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="tabMyTemplate" label="myTemplate">
<group id="grpCopyAndPasteCopy1" label="Copy&Paste 1">
<!-- HTML Entity (named) & -->
</group>
<group id="grpCopyAndPasteCopy2" label="Copy&Paste 2">
<!-- HTML Entity (decimal) & -->
</group>
<group id="grpCopyAndPasteCopy3" label="Copy&Paste 3">
<!-- HTML Entity (decimal) & -->
</group>
<group id="grpCopyAndPasteCopy4" label="Copy&Paste 4">
<!-- HTML Entity (hex) & -->
</group>
</tab>
</tabs>
</ribbon>
</customUI>
在Word 2010中打开MyTemplate.dotm
时,结果如下:
Here is the result when open MyTemplate.dotm
in Word 2010:
有人知道我应该如何解决这个问题吗?
Does anyone know how I should solve this problem?
推荐答案
使用标准菜单项时,这是一个常见问题.单个与号(&)被解释为快捷键(在按住Alt键时带有下划线的快捷键).
This is a common problem when working with standard menu items. A single ampersand (&) is interpreted as the shortcut key (the one that gets underlined when you hold down the Alt key).
显示文字'&'在标题中,将它们加倍:Copy&&Paste
.我不确定是否需要转义它们(如果这样做,请使用&&
,但是双倍字符应该可以为您提供所需的输出.
To show a literal '&' in the caption, double them: Copy&&Paste
. I'm not sure if you'll need to escape them or not (if you do, use &&
, but the doubled characters should give you the output you want.
这篇关于在组标签名称中使用“&"符号在Word 2010中开发功能区选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!