Share via


Office.Display interface

注意

この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。

メッセージの本文または件名に表示されるコンテンツを読み取りモードで一時的に設定するプロパティを提供します。

注釈

[ API セット: メールボックス プレビュー ]

最小アクセス許可レベル: 項目の読み取り/書き込み

適用される Outlook モード: メッセージの読み取り

プロパティ

body

読み取りモードでメッセージの本文に表示されるコンテンツを一時的に設定するオブジェクトを取得します。

subject

読み取りモードでメッセージの件名に表示されるコンテンツを一時的に設定するオブジェクトを取得します。

プロパティの詳細

body

注意

この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。

読み取りモードでメッセージの本文に表示されるコンテンツを一時的に設定するオブジェクトを取得します。

body: DisplayedBody;

プロパティ値

注釈

[ API セット: メールボックス プレビュー ]

最小アクセス許可レベル: 項目の読み取り/書き込み

適用される Outlook モード: メッセージの読み取り

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/set-displayed-body-subject.yaml

// This snippet temporarily sets the content displayed in the body of a message in read mode.
// The set content will remain visible until the user switches to a different message in the Reading Pane or closes the window of the current message.
const bodyText = $("#body-text-field")
  .val()
  .toString();
Office.context.mailbox.item.display.body.setAsync(bodyText, (asyncResult) => {
  if (asyncResult.status === Office.AsyncResultStatus.Failed) {
    console.log(`Action failed with error: ${asyncResult.error.message}`);
    return;
  }

  console.log("Temporarily set the content displayed in the body.");
});

subject

注意

この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。

読み取りモードでメッセージの件名に表示されるコンテンツを一時的に設定するオブジェクトを取得します。

subject: DisplayedSubject;

プロパティ値

注釈

[ API セット: メールボックス プレビュー ]

最小アクセス許可レベル: 項目の読み取り/書き込み

適用される Outlook モード: メッセージの読み取り

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/set-displayed-body-subject.yaml

// This snippet temporarily sets the content displayed in the subject field of a message in read mode.
// The set content will remain visible until the user switches to a different message in the Reading Pane or closes the window of the current message.
const subjectText = $("#subject-text-field")
  .val()
  .toString();
Office.context.mailbox.item.display.subject.setAsync(subjectText, (asyncResult) => {
  if (asyncResult.status === Office.AsyncResultStatus.Failed) {
    console.log(`Action failed with error: ${asyncResult.error.message}`);
    return;
  }

  console.log("Temporarily set the content displayed in the subject field.");
});