Office.NotificationMessageAction interface
通知メッセージのアクションの定義。
注釈
最小アクセス許可レベル: アイテムの読み取り
適用できる Outlook モード: 新規作成または読み取り
重要: モダン Outlook on the webでは、NotificationMessageAction
オブジェクトは新規作成モードでのみ使用できます。
例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/35-notifications/add-getall-remove.yaml
// Adds an informational message with actions to the mail item.
const id = $("#notificationId").val().toString();
const itemId = Office.context.mailbox.item.itemId;
const details = {
type: Office.MailboxEnums.ItemNotificationMessageType.InsightMessage,
message: "This is an insight notification with id = " + id,
icon: "icon1",
actions: [
{
actionText: "Open insight",
actionType: Office.MailboxEnums.ActionType.ShowTaskPane,
// Identify whether the current mail item is in read or compose mode to set the appropriate commandId value.
commandId: (itemId == undefined ? "PG.HelpCommand.Compose" : "PG.HelpCommand.Read"),
contextData: { a: "aValue", b: "bValue" }
}
]
};
Office.context.mailbox.item.notificationMessages.addAsync(id, details, handleResult);
プロパティ
action |
アクション リンクのテキスト。 |
action |
実行するアクションの種類。 |
command |
マニフェストで定義されているボタン。 |
context |
アクション ボタンがアドインに渡す必要がある JSON データ。 |
プロパティの詳細
actionText
アクション リンクのテキスト。
actionText: string;
プロパティ値
string
actionType
実行するアクションの種類。 ActionType.ShowTaskPane
は、サポートされている唯一のアクションです。
actionType: string | MailboxEnums.ActionType;
プロパティ値
string | Office.MailboxEnums.ActionType
commandId
マニフェストで定義されているボタン。
commandId: string;
プロパティ値
string
contextData
アクション ボタンがアドインに渡す必要がある JSON データ。
contextData: any;
プロパティ値
any
注釈
重要:
Outlook on Windows では、
any
種類はバージョン 2402 (ビルド 17308.20000) 以降でサポートされています。 以前のバージョンの Outlook on Windows では、型のみがstring
サポートされています。JSON データを取得するには、 を呼び出します
Office.context.mailboxitem.getInitializationContextAsync
。 を使用してJSON.stringify()
JSON 文字列を作成し、 プロパティにcontextData
割り当てる場合は、取得後に を使用して文字列をJSON.parse()
解析する必要があります。
Office Add-ins
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示