Reputation: 71
I have a custom add-in for Word (could also be for Excel).
The add-in has a ribbon with multiple groups and multiple controls (buttons) within them.
This is an ongoing project and some of the ribbon buttons are for users, and some are for testing/development purposes.
When I send the product to the client I only show certain buttons. I want the testing buttons to be completely invisible/inaccessible. I have tried setting the testing buttons/groups to visible = false
.
This works, in the sense that the buttons do not appear on the ribbon, but if the user goes to Word's quick access toolbar > More Commands > Choose Commands from dropdown and selects my custom add-in...
Then the user can see all of my buttons. Even the ones with no label.
I have tried looping the controls in the ribbon load method and setting the testing controls to enabled = false
, locked = true
, generatemember = false
, but none of these hide the buttons from the QAT menu. I also tried control.Dispose()
- no joy.
Is there anyway to set the properties of a ribbon button such that it is completely invisible and inaccessible to the user in the QAT??
Upvotes: 6
Views: 958
Reputation:
I would suggest you to create debug buttons dynamically. Define a constant variable like public constant string environment = "DEBUG";
and check it on start up
Upvotes: 1
Reputation: 464
Set the ApplicationMode.
Button CommandName='cmdExportMetadata' ApplicationModes='1'
Please see the below link too : https://msdn.microsoft.com/en-us/library/windows/desktop/dd940486(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ee264330(v=vs.85).aspx
Upvotes: 2