Office.MailboxEnums.AttachmentType enum
指定附件的类型。
注解
适用的 Outlook 模式:撰写或阅读
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/40-attachments/attachments-compose.yaml
Office.context.mailbox.item.getAttachmentsAsync(function (result) {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(result.error.message);
} else {
if (result.value.length > 0) {
for (let i = 0; i < result.value.length; i++) {
const attachment = result.value[i];
console.log("ID: " + attachment.id + "\n" +
"Name: " + attachment.name + "\n" +
"Size: " + attachment.size + "\n" +
"isInline: " + attachment.isInline);
switch (attachment.attachmentType) {
case Office.MailboxEnums.AttachmentType.Cloud:
console.log("Attachment type: Attachment is stored in a cloud location.");
break;
case Office.MailboxEnums.AttachmentType.File:
console.log("Attachment type: Attachment is a file.");
break;
case Office.MailboxEnums.AttachmentType.Item:
console.log("Attachment type: Attachment is an Exchange item.");
break;
}
}
}
else {
console.log("No attachments on this message.");
}
}
});
字段
File = "file" | 附件是一个文件。 |
Item = "item" | 附件是一个 Exchange 项目。 |
Cloud = "cloud" | 附件存储在云位置(如 OneDrive)中。 重要提示:在读取模式下, |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈