I have developed a small Ribbon for our company, which works fine when launched from it's dotm file - but I have problemswhen I try to store it in the Startup folder. I have stored it as a dotm file and copied it to the startup folder. The ribbons are perfectly visible when launching word, but every click on a menu item causes a runtime error 5941 :(
the 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>
some code behind.
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
Put your file under %appdata%\Microsoft\Templates\ And create another .dotm file which should be under StartUp folder and which would attach your file with ribbon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With