将符号插入 Office Ribbon XML 控件 [英] Inserting symbols into Office Ribbon XML controls

查看:48
本文介绍了将符号插入 Office Ribbon XML 控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用存储在 Word 模板的 customUI14.xml 文件中的 XML 从头开始​​为 Word 2010 构建功能区选项卡.我正在创建按钮,单击时会插入各种符号(欧元、节标记等)的文本.插入符号的代码工作正常,但我无法获取 XML 控件的标签来显示这些符号.例如,我尝试这样显示欧元符号:

I am building a ribbon tab for Word 2010 from scratch using XML stored within a Word template's customUI14.xml file. I am creating buttons that when clicked insert the text for various symbols (the euro, section mark, etc.) The code for inserting the symbols works fine, but I cannot get the labels of the XML controls to display these symbols. For example, I tried this to display a euro symbol:

 <group id="rxGroupSymbols" label="Symbols">
      <button id="rxbtnEuro" label="&#128;" size="normal" onAction="rxshared_click">
 </button>
 </group>

但是当使用 ASCII 符号等效项时,"&#128;" 不会生成欧元符号,也不会生成其他变体,例如 &#128;.

But when using ASCII symbol equivalents the "&#128;" does not generate the euro symbol, nor do other variations such as &amp;#128;.

如何让 Ribbon XML 在 Office 功能区控件上显示这些字符?谢谢.

How can I get the Ribbon XML to display these characters on Office ribbon controls? Thanks.

推荐答案

事实证明,XML 只允许五个特殊字符(字符实体),详见 这个维基百科条目.解决方案是使用 getLabel 属性:

It turns out that XML allows only five special characters (character entities) as detailed in this Wikipedia entry. The solution was to use the getLabel attribute:

 <group id="rxGroupSymbols" label="Symbols">
      <button id="rxbtnEuro" getLabel="getlabel" size="normal" onAction="rxshared_click">
      </button>
 </group>

然后将 ASCII 符号作为字符串发送到 XML 中:

And send the ASCII symbol into the XML as a string:

 Public Function getlabel(control As IRibbonControl, ByRef Label)
      Label = Chr(128)
 End Function

这篇关于将符号插入 Office Ribbon XML 控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆