Office.Item interface

アイテム名前空間は、現在選択されているメッセージ、会議出席依頼、または予定にアクセスするために使用されます。 プロパティを使用して、項目の種類を itemType 決定できます。

メンバーの完全な一覧を表示するには、[ オブジェクト モデル ] ページを参照してください。

特定の種類またはモードについてのみ IntelliSense を表示する場合は、この項目を次のいずれかにキャストします。

注釈

最小アクセス許可レベル: 制限

適用できる Outlook モード: 予定の開催者、予定の出席者、メッセージの作成、メッセージの読み取り

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

const itemType = Office.context.mailbox.item.itemType;
switch (itemType) {
    case Office.MailboxEnums.ItemType.Appointment:
        console.log(`Current item is an ${itemType}.`);
        break;
    case Office.MailboxEnums.ItemType.Message:
        console.log(`Current item is a ${itemType}. A message could be an email, meeting request, meeting response, or meeting cancellation.`);
        break;
}