diff --git a/snippet-extractor-metadata/outlook.xlsx b/snippet-extractor-metadata/outlook.xlsx index fad790656..d3bcea07d 100644 Binary files a/snippet-extractor-metadata/outlook.xlsx and b/snippet-extractor-metadata/outlook.xlsx differ diff --git a/snippet-extractor-output/snippets.yaml b/snippet-extractor-output/snippets.yaml index a8df1a586..73e0396d1 100644 --- a/snippet-extractor-output/snippets.yaml +++ b/snippet-extractor-output/snippets.yaml @@ -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: