Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified snippet-extractor-metadata/outlook.xlsx
Binary file not shown.
48 changes: 48 additions & 0 deletions snippet-extractor-output/snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10469,6 +10469,54 @@
} else {
console.log("This mail item doesn't contain any attachments.");
}
'Office.AttachmentDetailsCompose:interface':
- >-
// 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((result) => {
if (result.status === Office.AsyncResultStatus.Failed) {
console.error(result.error.message);
return;
}

if (result.value.length > 0) {
for (let i = 0; i < result.value.length; i++) {
const attachment = result.value[i];
let attachmentType;
switch (attachment.attachmentType) {
case Office.MailboxEnums.AttachmentType.Cloud:
attachmentType = "Attachment is stored in a cloud location";
break;
case Office.MailboxEnums.AttachmentType.File:
attachmentType = "Attachment is a file";
break;
case Office.MailboxEnums.AttachmentType.Item:
attachmentType = "Attachment is an Exchange item";
break;
}
console.log(
"ID: " +
attachment.id +
"\n" +
"Type: " +
attachmentType +
"\n" +
"Name: " +
attachment.name +
"\n" +
"Size: " +
attachment.size +
"\n" +
"isInline: " +
attachment.isInline
);
}
} else {
console.log("No attachments on this message.");
}
});
'Office.Body:interface':
- >-
// Link to full sample:
Expand Down