Office.Diagnostics interface

Outlook アドインに診断情報を提供します。

注釈

[ API セット: メールボックス 1.1 ]

最小アクセス許可レベル: 読み取り項目

適用できる Outlook モード: 新規作成または読み取り

メールボックス要件セット 1.5 以降では、 Office.context.diagnostics プロパティを使用して同様の情報を取得することもできます。

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-diagnostic-information.yaml

// This function gets a mailbox's diagnostic information, such as Outlook client and version, and logs it to the console.
const diagnostics = Office.context.mailbox.diagnostics;
console.log(`Client application: ${diagnostics.hostName}`);
console.log(`Client version: ${diagnostics.hostVersion}`);

switch (diagnostics.OWAView) {
  case undefined:
    console.log("Current view (Outlook on the web only): Not applicable. An Outlook desktop client is in use.");
    break;
  case Office.MailboxEnums.OWAView.OneColumnNarrow:
    console.log("Current view (Outlook on the web only): Viewed from an older generation mobile phone");
    break;
  case Office.MailboxEnums.OWAView.OneColumn:
    console.log("Current view (Outlook on the web only): Viewed from a newer generation mobile phone");
    break;
  case Office.MailboxEnums.OWAView.TwoColumns:
    console.log("Current view (Outlook on the web only): Viewed from a tablet");
    break;
  case Office.MailboxEnums.OWAView.ThreeColumns:
    console.log("Current view (Outlook on the web only): Viewed from a desktop computer");
    break;
}

プロパティ

hostName

Outlook クライアントの種類を表す文字列を取得します。

文字列には、 OutlooknewOutlookWindowsOutlookWebAppOutlookIOS、または OutlookAndroidのいずれかの値を指定できます。

hostVersion

Outlook クライアントまたは Exchange Server のバージョン ("15.0.468.0" など) を表す文字列を取得します。

メール アドインが Outlook on Windows (クラシック)、Mac、またはモバイル デバイスで実行されている場合、 hostVersion プロパティは Outlook クライアントのバージョンを返します。 Outlook on the web と 新しい Outlook on Windows では、プロパティは Exchange Server のバージョンを返します。

OWAView

Outlook on the web の現在のビューを表す文字列を取得します。

返される文字列には、 OneColumnTwoColumns、または ThreeColumnsのいずれかの値を指定できます。

アプリケーションが Outlook on the web でない場合、このプロパティにアクセスすると未定義になります。

Outlook on the web には、画面とウィンドウの幅と表示できる列の数に対応する 3 つのビューがあります。

  • OneColumn は、画面が狭いときに表示されます。 Outlook on the web では、スマートフォンの画面全体でこの単一列レイアウトが使用されます。

  • TwoColumns は、画面の幅が広いときに表示されます。 Outlook on the web では、ほとんどのタブレットでこのビューが使用されます。

  • ThreeColumns は、画面が広いときに表示されます。 たとえば、Outlook on the web では、デスクトップ コンピューターの全画面表示ウィンドウでこのビューを使用します。

プロパティの詳細

hostName

Outlook クライアントの種類を表す文字列を取得します。

文字列には、 OutlooknewOutlookWindowsOutlookWebAppOutlookIOS、または OutlookAndroidのいずれかの値を指定できます。

hostName: string;

プロパティ値

string

注釈

[ API セット: メールボックス 1.1 ]

最小アクセス許可レベル: 読み取り項目

適用できる Outlook モード: 新規作成または読み取り

重要: Outlook 値は、Windows および Mac の Outlook デスクトップ クライアントに対して返されます。 newOutlookWindows は、 新しい Outlook on Windows デスクトップ クライアントに返されます。

hostVersion

Outlook クライアントまたは Exchange Server のバージョン ("15.0.468.0" など) を表す文字列を取得します。

メール アドインが Outlook on Windows (クラシック)、Mac、またはモバイル デバイスで実行されている場合、 hostVersion プロパティは Outlook クライアントのバージョンを返します。 Outlook on the web と 新しい Outlook on Windows では、プロパティは Exchange Server のバージョンを返します。

hostVersion: string;

プロパティ値

string

注釈

[ API セット: メールボックス 1.1 ]

最小アクセス許可レベル: 読み取り項目

適用できる Outlook モード: 新規作成または読み取り

OWAView

Outlook on the web の現在のビューを表す文字列を取得します。

返される文字列には、 OneColumnTwoColumns、または ThreeColumnsのいずれかの値を指定できます。

アプリケーションが Outlook on the web でない場合、このプロパティにアクセスすると未定義になります。

Outlook on the web には、画面とウィンドウの幅と表示できる列の数に対応する 3 つのビューがあります。

  • OneColumn は、画面が狭いときに表示されます。 Outlook on the web では、スマートフォンの画面全体でこの単一列レイアウトが使用されます。

  • TwoColumns は、画面の幅が広いときに表示されます。 Outlook on the web では、ほとんどのタブレットでこのビューが使用されます。

  • ThreeColumns は、画面が広いときに表示されます。 たとえば、Outlook on the web では、デスクトップ コンピューターの全画面表示ウィンドウでこのビューを使用します。

OWAView: MailboxEnums.OWAView | "OneColumn" | "TwoColumns" | "ThreeColumns";

プロパティ値

Office.MailboxEnums.OWAView | "OneColumn" | "TwoColumns" | "ThreeColumns"

注釈

[ API セット: メールボックス 1.1 ]

最小アクセス許可レベル: 読み取り項目

適用できる Outlook モード: 新規作成または読み取り