Office.Control interface
個々のコントロールまたはコマンドと、そのコントロールが持つ必要がある状態を表します。
注釈
Control
オブジェクトとそのプロパティの使用方法を示すコード サンプルについては、「アドイン コマンドの可用性の変更」および「カスタム コンテキスト タブの作成」を参照してください。
要件セット: RibbonAPI 1.1
例
// This snippet enables a control (a button) in a custom ribbon tab.
// Note that "MyButton", "OfficeAddinTab1", and "CustomGroup111" are defined in the manifest.
const enableButton = async () => {
const button: Control = { id: "MyButton", enabled: true };
const parentGroup: Group = { id: "CustomGroup111", controls: [button] };
const parentTab: Tab = { id: "OfficeAddinTab1", groups: [parentGroup] };
const ribbonUpdater: RibbonUpdaterData = { tabs: [parentTab] };
Office.ribbon.requestUpdate(ribbonUpdater);
}
プロパティの詳細
enabled
コントロールを有効または無効にするかどうかを示します。 既定値は true です。
enabled?: boolean;
プロパティ値
boolean
id
マニフェストで指定されたコントロールの識別子。
id: string;
プロパティ値
string