Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditionally enable/disable button control?

Tags:

office-js

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?

like image 508
ryan Avatar asked Jun 05 '17 16:06

ryan


1 Answers

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/

like image 147
Slava Ivanov Avatar answered Jan 02 '23 11:01

Slava Ivanov