Office.EmailAddressDetails interface

電子メール メッセージまたは予定の送信者または指定受信者の電子メール プロパティを提供します。

プロパティ

appointmentResponse

予定に対して出席者が戻した応答を取得します。 このプロパティは、optionalAttendees プロパティまたは requiredAttendees プロパティで表わされる予定の出席者にのみ適用されます。 このプロパティは、他のシナリオでは未定義を返します。

displayName

電子メール アドレスに関連付けられた表示名を取得します。

emailAddress

SMTP 電子メール アドレスを取得します。

recipientType

受信者の電子メール アドレスの種類を取得します。

プロパティの詳細

appointmentResponse

予定に対して出席者が戻した応答を取得します。 このプロパティは、optionalAttendees プロパティまたは requiredAttendees プロパティで表わされる予定の出席者にのみ適用されます。 このプロパティは、他のシナリオでは未定義を返します。

appointmentResponse: MailboxEnums.ResponseType | string;

プロパティ値

// The following sample provides the responses from required attendees.
// Note that this sample needs the add-in to be in Appointment Read (Attendee) mode.
const requiredAttendees = Office.context.mailbox.item.requiredAttendees;
console.log("There are " + requiredAttendees.length + " required attendees.")
requiredAttendees.forEach(function (requiredAttendee) {
    console.log("Attendee " + requiredAttendee.displayName + ": " + requiredAttendee.appointmentResponse);
});

displayName

電子メール アドレスに関連付けられた表示名を取得します。

displayName: string;

プロパティ値

string

const organizerName = Office.context.mailbox.item.organizer.displayName;
console.log("Organizer: " + organizerName);

emailAddress

SMTP 電子メール アドレスを取得します。

emailAddress: string;

プロパティ値

string

const organizerAddress = Office.context.mailbox.item.organizer.emailAddress;
console.log("Organizer's email address: " + organizerAddress);

recipientType

受信者の電子メール アドレスの種類を取得します。

recipientType: MailboxEnums.RecipientType | string;

プロパティ値

注釈

重要:

  • recipientTypeプロパティ値は、Office.context.mailbox.item.from.getAsync メソッドと Office.context.mailbox.item.organizer.getAsync メソッドでは返されません。 電子メールの送信者または予定の主催者は、常に電子メール アドレスが Exchange サーバー上にあるユーザーです。

  • メール アイテムの作成中に、以前に選択した差出人アカウントとは異なるドメインの差出人アカウントに切り替えると、既存の受信者の recipientType プロパティの値は更新されず、以前に選択したアカウントのドメインに基づきます。 アカウントの切り替え後に正しい受信者の種類を取得するには、まず既存の受信者を削除してから、メール アイテムに追加し直す必要があります。

const requiredAttendees = Office.context.mailbox.item.requiredAttendees;
console.log("There are " + requiredAttendees.length + " required attendees.")
requiredAttendees.forEach(function (requiredAttendee) {
    console.log("Attendee " + requiredAttendee.displayName + ": " + requiredAttendee.recipientType);
});