次の方法で共有


Office.ContextMenuUpdaterData interface

コンテキスト メニューの変更を表します。

詳細については、「 アドイン コマンドの可用性を変更する」を参照してください。

注釈

要件セット: ContextMenuAPI 1.1

プロパティ

controls

Office.contextMenu.requestUpdate を使用して状態が設定されているコンテキスト メニュー コントロールのコレクション。

プロパティの詳細

controls

Office.contextMenu.requestUpdate を使用して状態が設定されているコンテキスト メニュー コントロールのコレクション。

controls: ContextMenuControl[];

プロパティ値

// Change the availability of custom buttons on the context menu.
await Office.contextMenu.requestUpdate({
    controls: [
        {
            id: Addin.CtxMenu.Button1,
            enabled: true
        },
        {
            id: Addin.CtxMenu.Button2,
            enabled: false
        },
    ]
});