<?xml version="1.0" encoding="utf-8" ?>
<!--PLEASE NOTE: The CustomUI_OnLoad method is a virtual member of the COMAddin base class -->
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="CustomUI_OnLoad">
<ribbon>
<tabs>
<tab id="CustomRibbonUI" label="CustomRibbonUI">
<group id="group1" label="CustomRibbonUI1">
<button id="aboutButton1" label="About1" imageMso="AdvertisePublishAs" size="large" onAction="AboutButton_Click" />
</group>
<group id="group2" label="CustomRibbonUI2" getVisible="GetVisible" tag="grpGroup2">
<button id="aboutButton2" label="About2" imageMso="AdvertisePublishAs" size="large" onAction="AboutButton_Click" />
</group>
<group id="group3" label="CustomRibbonUI3" getVisible="GetVisible" tag="grpGroup3">
<button id="aboutButton3" label="About3" imageMso="AdvertisePublishAs" size="large" onAction="AboutButton_Click" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
And I like to toggle group2 and group3 based on an event in my code. If you could get me started in the right direction I'd appreciate it. I can't seem to get a custom onload event to fire.
I am trying to show/hide groups on my custom Ribbon tab without success. I have tried to convert the code from Ron de Bruin's site (https://www.rondebruin.nl/win/s2/win012.htm Hide-Display-Group-Control) from VBA to VB.NET bastardizing it with code from the examples for NetOffice form GitHub (https://github.com/netoffice/NetOffice/tree/master/Examples/Excel/VB/NetOffice%20COMAddin%20Examples/Extended). The GitHub code seems to be for an outdated version. My RibbonUI.xml looks like this:
<?xml version="1.0" encoding="utf-8" ?> <!--PLEASE NOTE: The CustomUI_OnLoad method is a virtual member of the COMAddin base class --> <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="CustomUI_OnLoad"> <ribbon> <tabs> <tab id="CustomRibbonUI" label="CustomRibbonUI"> <group id="group1" label="CustomRibbonUI1"> <button id="aboutButton1" label="About1" imageMso="AdvertisePublishAs" size="large" onAction="AboutButton_Click" /> </group> <group id="group2" label="CustomRibbonUI2" getVisible="GetVisible" tag="grpGroup2"> <button id="aboutButton2" label="About2" imageMso="AdvertisePublishAs" size="large" onAction="AboutButton_Click" /> </group> <group id="group3" label="CustomRibbonUI3" getVisible="GetVisible" tag="grpGroup3"> <button id="aboutButton3" label="About3" imageMso="AdvertisePublishAs" size="large" onAction="AboutButton_Click" /> </group> </tab> </tabs> </ribbon> </customUI>
And I like to toggle group2 and group3 based on an event in my code. If you could get me started in the right direction I'd appreciate it. I can't seem to get a custom onload event to fire.