OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
641 stars 92 forks source link

GetAttachmentsAsync does not return the list of attachments in Outlook Online #4406

Open barisbikmaz opened 3 weeks ago

barisbikmaz commented 3 weeks ago

Provide required information needed to triage your issue

When using the method getAttachmentsAsync in Outlook Online, the list of the attached files are not listed. You always get an empty array. On Outlook for Windows the returned list is correct.

Your Environment

Expected behavior

Office.context.mailbox.item.getAttachmentsAsync should return the list of attached files, also the inline ones.

Current behavior

Outlook Online An empty array is returned. image

Same call in Outlook for Windows image

Steps to reproduce

  1. Open Outlook Online
  2. Create a new mail
  3. Attach a file to the mail
  4. Open Script Lab
  5. call Office.context.mailbox.item.getAttachmentsAsync(console.log) in DevTools or ScriptLab

Context

I am working on a signature app which uses inline images. When switching a signature, which has new images, I want to delete existing inline image attachments. But currently I can't see which attachments are attached to the mail.

neprasad-microsoft commented 2 weeks ago

Hi @barisbikmaz Can you tell us how you are attaching the file? If you are using an API please paste the API call here so that we can reproduce on our side.

barisbikmaz commented 5 days ago

@neprasad-microsoft Was on vacation, could therefore not reply.

I open Outlook Online and run following code to add an inline attachment:

Office.context.mailbox.item.addFileAttachmentFromBase64Async('some-base64-image','myimage.png',{ isInline: true })

To be sure that the image is attached, I insert a signature referencing this image.

Office.context.mailbox.item.body.setSignatureAsync('Greetings<br/><img src="cid:myimage.png" />', { coercionType: 'html' });

This works. But when I run

Office.context.mailbox.item.getAttachmentsAsync(console.log)

it does not return the inline attachment.

mmanjaree-msft commented 4 days ago

Thanks for reporting this issue. We have put this in our backlog but unfortunately we do not have any timelines to share at this point. Internal tracking id: 276714

microsoft-github-policy-service[bot] commented 13 hours ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!