How to remove a specific Ribbon tab

How to remove a specific Ribbon tab

theis_knudsen
Explorer Explorer
173 Views
1 Reply
Message 1 of 2

How to remove a specific Ribbon tab

theis_knudsen
Explorer
Explorer

Hello.

Is it possible to make a Macro to remove a specific Ribbon tab? 

Right now, when i make an update and everyone else want it they have to do manual work.

I made one that imports the new macro, but you have to delete the old one because i can't just say number 2 because everyone has different ribbon setups.

FORM CustomRibbon CustomiseRibbon
EDIT CUSTOMRIBBON SOURCE
EDIT CUSTOMRIBBON IMPORT FILEOPEN
"Path to the file"
MESSAGE INFO "Delete old Genistreger and press OK"
0 Likes
Accepted solutions (1)
174 Views
1 Reply
Reply (1)
Message 2 of 2

Sean571
Advocate
Advocate
Accepted solution

Here you go, just replace the variable "tabToFind" with the name of the tab you want removed

 

//Name of tab to remove 
string tabToFind = "New Tab"  


// There are 17 default ribbon tabs if you include the quick access toolbar
int numberOfDefaultTabs = 17 

string list tabs = ribbon_visible_tabs() 
int numOfActualTabs = size(tabs)

int i = $numberOfDefaultTabs
while $i < $numOfActualTabs {
    string widgetName = "Ribbon." + $tabs[$i]
    string tabName = $widget($widgetName).Label
    
    if lcase($tabName) == lcase($tabToFind) {

        string cmd = "EDIT CUSTOMRIBBON DESTINATION '" + $widgetName + "'"
        docommand $cmd

        $cmd = "EDIT CUSTOMRIBBON REMOVE '" + $widgetName + "'"
        docommand $cmd

        EDIT CUSTOMRIBBON APPLY FORM CANCEL CUSTOMRIBBON
        break
    }

    $i = $i+1
}

 

Sean Wroblewski
Applications Engineer