1

我正在尝试在 Excel 2013 中创建一个带有 2 个按钮的新功能区。由于 Excel CustomUI 功能区布局如何使用 VBA 添加自定义功能区选项卡,我能够使用自定义 UI 编辑器创建它。

当我输入代码为

<button id="aa" label="CORE"  onAction = "HMA_CORE"/> 

它有效,但一旦我尝试这段代码

<button id="aa" label="CORE" size = "large" onAction = "HMA_CORE"/>

然后在customUI中单击验证,它说“未声明大小属性”。我不确定要添加什么。我也看到了http://www.rondebruin.nl/win/s2/win009.htm,但代码看起来一样。任何帮助将不胜感激。谢谢

按钮的代码如下所示

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
   <ribbon>
      <tabs>
         <tab id="toolRibbon" label="HMA-FUNCTIONS">
            <group id="groupDocument" label="HMA-xml outputs">
               <buttonGroup id="a">
                  <button id="aa" label="CORE" onAction = "HMA_CORE"/>
                  <button id="ab" label="PLANT" onAction = "HMA_PLANT"/>
               </buttonGroup>
            </group>
         </tab>
      </tabs>
   </ribbon>
</customUI>
4

2 回答 2

2

尝试使用 Office 中的内置图标(摆脱buttonGroup

在此处输入图像描述

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
   <ribbon>
      <tabs>
         <tab id="toolRibbon" label="HMA-FUNCTIONS" insertBeforeMso="TabHome">
            <group id="groupDocument" label="HMA-xml outputs">
                  <button id="aa" label="CORE" imageMso="MacroArguments" onAction = "HMA_CORE" size="large" />
                  <button id="ab" label="PLANT" imageMso="PictureBrightnessGallery" onAction = "HMA_PLANT" size="large" />
            </group>
         </tab>
      </tabs>
   </ribbon>
</customUI>

参考:Office 2007 图标库

于 2013-09-16T02:12:30.677 回答
0

问题是“大小”和“更大”声明之间的空间!把它们放在一起

错误>>尺寸=“更大”

正确>>尺寸=“更大”

于 2021-03-17T13:10:44.603 回答