04-18-2022
03:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-18-2022
03:45 AM
To disable and enable commands you need to get hold of the "ControlDefinition". This property can "Enables/Disables the UIDefinition objects.". That could work like this:
Dim Ribbon As Ribbon = ThisApplication.UserInterfaceManager.Ribbons.Item("Ribbon name")
Dim ribbonTab As RibbonTab = Ribbon.RibbonTabs.Item("Ribbon tab name")
Dim ribbonPanel As RibbonPanel = ribbonTab.RibbonPanels.Item("Ribbon panel name")
Dim commandControl As CommandControl = ribbonPanel.CommandControls.Item("Command controls name")
commandControl.ControlDefinition.Enabled = False
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com