Office.AttachmentDetails interface

サーバーからのアイテムの添付ファイルを表します。 閲覧モードのみ。

オブジェクトの AttachmentDetails 配列は、予定またはメッセージ項目の attachments プロパティとして返されます。

注釈

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

最小アクセス許可レベル: アイテムの読み取り

適用される Outlook モード: 読み取り

// The following code builds an HTML string with details
// of all attachments on the current item.
const item = Office.context.mailbox.item;
let outputString = "";

if (item.attachments.length > 0) {
    for (let i = 0 ; i < item.attachments.length ; i++) {
        const attachment = item.attachments[i];
        outputString += "<BR>" + i + ". Name: ";
        outputString += attachment.name;
        outputString += "<BR>ID: " + attachment.id;
        outputString += "<BR>contentType: " + attachment.contentType;
        outputString += "<BR>size: " + attachment.size;
        outputString += "<BR>attachmentType: " + attachment.attachmentType;
        outputString += "<BR>isInline: " + attachment.isInline;
    }
}

console.log(outputString);

プロパティ

attachmentType

添付ファイルの種類を示す値を取得します。

contentType

添付ファイルの MIME コンテンツ タイプを取得します。

警告: 値は添付ファイルの拡張機能の直接参照ですが contentType 、内部マッピングはアクティブに維持されないため、このプロパティは非推奨になりました。 特定の種類が必要な場合は、添付ファイルの拡張機能を取得し、それに応じて処理します。 詳細については、 関連するブログ投稿を参照してください。

id

添付ファイルの Exchange 添付ファイル ID を取得します。 ただし、添付ファイルの種類が の場合は MailboxEnums.AttachmentType.Cloud、ファイルの URL が返されます。

isInline

添付ファイルをアイテムの本文に表示するかどうかを示す値を取得します。

name

添付ファイルの名前を取得します。

重要: ドラッグ アンド ドロップまたは "アイテムの添付" によって添付されたメッセージまたは予定アイテムの場合、 name Outlook on Mac にはファイル拡張子が含まれますが、Web または Windows 上の拡張機能は除外されます。

size

添付ファイルのサイズをバイト単位で取得します。

プロパティの詳細

attachmentType

添付ファイルの種類を示す値を取得します。

attachmentType: MailboxEnums.AttachmentType | string;

プロパティ値

contentType

警告

この API は非推奨になりました。

If you require specific content types, grab the attachment's extension and process accordingly.

添付ファイルの MIME コンテンツ タイプを取得します。

警告: 値は添付ファイルの拡張機能の直接参照ですが contentType 、内部マッピングはアクティブに維持されないため、このプロパティは非推奨になりました。 特定の種類が必要な場合は、添付ファイルの拡張機能を取得し、それに応じて処理します。 詳細については、 関連するブログ投稿を参照してください。

contentType: string;

プロパティ値

string

id

添付ファイルの Exchange 添付ファイル ID を取得します。 ただし、添付ファイルの種類が の場合は MailboxEnums.AttachmentType.Cloud、ファイルの URL が返されます。

id: string;

プロパティ値

string

isInline

添付ファイルをアイテムの本文に表示するかどうかを示す値を取得します。

isInline: boolean;

プロパティ値

boolean

name

添付ファイルの名前を取得します。

重要: ドラッグ アンド ドロップまたは "アイテムの添付" によって添付されたメッセージまたは予定アイテムの場合、 name Outlook on Mac にはファイル拡張子が含まれますが、Web または Windows 上の拡張機能は除外されます。

name: string;

プロパティ値

string

size

添付ファイルのサイズをバイト単位で取得します。

size: number;

プロパティ値

number