我为我们公司开发了一个小功能区,从它的 dotm 文件启动时工作正常 - 但是当我尝试将它存储在 Startup 文件夹中时遇到问题。我已将其存储为 dotm 文件并将其复制到启动文件夹中。启动 word 时功能区完全可见,但每次单击菜单项都会导致运行时错误 5941 :(
XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonControl.Onload">
<ribbon>
<tabs>
<tab id="Best" label="My Tools">
<group id="FBCATI" visible="true" label="Fragebogen">
<dropDown id="FBC1" label="CATI"
getItemCount="RibbonControl.GetItemCount"
getItemLabel="RibbonControl.GetItemLabel"
getSelectedItemIndex="RibbonControl.GetSelectedItemIndex"
onAction="RibbonControl.MyCatiMacro"
/>
<dropDown id="FBW1" label="WEB"
getItemCount="RibbonControl.GetItemCount"
getItemLabel="RibbonControl.GetItemLabel"
getSelectedItemIndex="RibbonControl.GetSelectedItemIndex"
onAction="RibbonControl.MyWebMacro"
/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
后面有一些代码。
Sub Onload(ribbon As IRibbonUI)
'Creates a ribbon instance for use in this project
Set myRibbon = ribbon
End Sub
'Callback for DropDown GetItemCount
Sub GetItemCount(ByVal control As IRibbonControl, ByRef count)
'Tell the ribbon to show 4 items in the dropdown
count = 6
End Sub