Office.Diagnostics interface
Outlook アドインに診断情報を提供します。
注釈
最小アクセス許可レベル: 読み取り項目
適用できる Outlook モード: Composeまたは読み取り
メールボックス要件セット 1.5 以降では、Office.context.診断 プロパティを使用して同様の情報を取得することもできます。
例
// 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;
}
プロパティ
| ews | Exchange Web Services (EWS) コールバック トークンがorganizationでサポートされているかどうかを識別するオブジェクトを取得します。 |
| host |
Outlook クライアントの種類を表す文字列を取得します。 文字列には、 |
| host |
Outlook クライアントまたはExchange Serverのバージョン ("15.0.468.0" など) を表す文字列を取得します。 メール アドインが Outlook on Windows (クラシック)、Mac、またはモバイル デバイスで実行されている場合、 |
| OWAView | Outlook on the webの現在のビューを表す文字列を取得します。 返される文字列には、 アプリケーションがOutlook on the webされていない場合、このプロパティにアクセスすると未定義になります。 Outlook on the webには、画面とウィンドウの幅と表示できる列の数に対応する 3 つのビューがあります。
|
プロパティの詳細
ews
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
Exchange Web Services (EWS) コールバック トークンがorganizationでサポートされているかどうかを識別するオブジェクトを取得します。
ews: Ews;
プロパティ値
注釈
最小アクセス許可レベル: 読み取り項目
適用できる Outlook モード: Composeまたは読み取り
重要:
ewsプロパティは、Outlook on the web および Windows (新規およびクラシック (バージョン 2510、ビルド 19328.20000 以降) でプレビューできます)。レガシ Exchange Onlineユーザー ID トークンとコールバック トークンはサポートされなくなり、すべての Microsoft 365 テナントでオフになっています。 Outlook アドインで委任されたユーザー アクセスまたはユーザー ID が必要な場合は、MSAL (Microsoft Authentication Library) と入れ子になったアプリ認証 (NAA) を使用することをお勧めします。 Exchange ユーザー ID トークンは、引き続き Exchange オンプレミスでサポートされています。 詳細については、「 入れ子になったアプリ認証に関する FAQ」を参照してください。
例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/get-token-status.yaml
Office.context.mailbox.diagnostics.ews.getTokenStatusAsync({ isRest: false }, (result) => {
if (result.status === Office.AsyncResultStatus.Failed) {
console.log(result.error.message);
return;
}
const status = result.value;
switch (status) {
case Office.MailboxEnums.TokenStatus.Enabled:
console.log("EWS callback tokens are enabled.");
break;
case Office.MailboxEnums.TokenStatus.Disabled:
console.log("EWS callback tokens are disabled.");
break;
case Office.MailboxEnums.TokenStatus.Removed:
console.log(
"The organization has an Exchange Online environment. Legacy Exchange tokens are no longer supported.",
);
break;
}
});
hostName
Outlook クライアントの種類を表す文字列を取得します。
文字列には、 Outlook、 newOutlookWindows、 OutlookWebApp、 OutlookIOS、または OutlookAndroidのいずれかの値を指定できます。
hostName: string;
プロパティ値
string
注釈
最小アクセス許可レベル: 読み取り項目
適用できる Outlook モード: Composeまたは読み取り
重要: Outlook 値は、Outlook on Windows (クラシック) と Mac で返されます。
newOutlookWindowsは、Windows の新しい Outlook に対して返されます。
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
注釈
最小アクセス許可レベル: 読み取り項目
適用できる Outlook モード: Composeまたは読み取り
OWAView
Outlook on the webの現在のビューを表す文字列を取得します。
返される文字列には、 OneColumn、 TwoColumns、または 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"
注釈
最小アクセス許可レベル: 読み取り項目
適用できる Outlook モード: Composeまたは読み取り