ryan
ryan

Reputation: 1463

Conditionally enable/disable button control?

I've looked through the docs at https://dev.office.com/reference/add-ins/manifest/control but can't find anything.

I want to disable a button on the ribbon unless a certain condition is met. The condition would be the presence of a custom property on the selected mail item.

Can it be done?

Upvotes: 5

Views: 1477

Answers (1)

Slava Ivanov
Slava Ivanov

Reputation: 6912

IMPORTANT UPDATE:

Enabling and Disabling Add-in Commands is now available in Preview for Excel. As part of AddinCommands 1.1, this feature supposed to be available for all Office products in the future.

THE OLD ANSWER:

Can it be done?

Nope.

Add-in commands for Outlook doesn't support dynamic enabling/disabling ribbon items. Activation rules are for context type of Outlook add-ins, which is currently not recommended way to write add-ins and they are not accepted by Office store.

Add-in commands for Excel, Word, and PowerPoint doesn't support dynamic enabling/disabling ribbon items either.

According to documentation on Control element of the Manifest none of the available controls have "enable/disable" attribute or tag.

If this is something you would like to see in upcoming releases, you may post/upvote your suggestion at https://officespdev.uservoice.com/

Upvotes: 6

Related Questions