IN this manifest/enabled we can disable a Control type Button.
for example:
<Control xsi:type="Button" id="BtnOpenTaskpane">
<Label resid="BtnOpenTaskpane.Label" />
<Supertip>
<!-- ToolTip title. resid must point to a ShortString resource. -->
<Title resid="BtnOpenTaskpane.Label" />
<!-- ToolTip description. resid must point to a LongString resource. -->
<Description resid="BtnOpenTaskpane.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<!-- This is what happens when the command is triggered Supported actions are ExecuteFunction-->
<Action xsi:type="ExecuteFunction">
<FunctionName>btnopentaskpane</FunctionName>
</Action>
<Enabled>false</Enabled> <!--Disable this Control-->
</Control>
Now I have Control type Menu
for example:
<Control xsi:type="Menu" id="Contoso.TaskpaneButton2">
<Label resid="Contoso.TaskpaneButton2.Label" />
<Supertip>
<!-- ToolTip title. resid must point to a ShortString resource. -->
<Title resid="Contoso.TaskpaneButton2.Label" />
<!--ToolTip description. resid must point to a LongString resource.-->
<Description resid="Contoso.TaskpaneButton2.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="heading1-16" />
<bt:Image size="32" resid="heading1-32" />
<bt:Image size="80" resid="heading1-80" />
</Icon>
<Items>
<Item id="itemPartTitle">
<Label resid="Group2.Item1.Label"/>
<Supertip>
<Title resid="Group2.Item1.Label" />
<Description resid="Group2.Item1.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Contoso.tpicon_16x16" />
<bt:Image size="32" resid="Contoso.tpicon_32x32" />
<bt:Image size="80" resid="Contoso.tpicon_80x80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>PartTitle</FunctionName>
</Action>
</Item>
</Items>
<!--Here We can't Add <Enabled>false</Enabled>-->
</Control>
I think we can't disable a Control type Menu because it have not Action.
In this case I think we can Disable a Menu Item.
<Items>
<Item id="itemPartTitle">
<Label resid="Group2.Item1.Label"/>
<Supertip>
<Title resid="Group2.Item1.Label" />
<Description resid="Group2.Item1.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Contoso.tpicon_16x16" />
<bt:Image size="32" resid="Contoso.tpicon_32x32" />
<bt:Image size="80" resid="Contoso.tpicon_80x80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>PartTitle</FunctionName>
</Action>
<Enabled>false</Enabled>
</Item>
Here Again a question can we Enable Item
function enableButton() {
Office.ribbon.requestUpdate({
tabs: [
{
id: "OfficeAppTab1",
groups: [
{
id: "CustomGroup111",
controls: [
{
id: "MyButton",
enabled: true
}
]
}
]
}
]
});
}
In this we have controls to Enable is that work fro Item