Hello Marjolein Bente,
Thank you for reaching out to Microsoft Q&A forum about the issue with your Outlook web add-in.
Regarding the situation, when the getAttachmentContentAsync API fails with an underlying 404 error on the GetFileAttachment request, while getAttachmentsAsync works correctly. This could happen in specific scenarios: when an inline image is added before selecting a particular panel in your add-in, and when a default setting triggers a server API call during the mounting of a Vue subcomponent in that panel. Delaying or avoiding that API call during mount seems to prevent the issue. You've tested this on Outlook web (Firefox on macOS) and New Outlook (Windows 11 via Parallels on macOS) and using Office.onReady() helps sporadically but not consistently.
This appears to be related to timing or race conditions in the Office.js API during the ItemSend event, possibly interacting with your add-in's lifecycle and network calls. It's consistent with some reported behaviors in compose/send scenarios, but to pinpoint the exact cause and provide targeted guidance, I need more details from your implementation.
Could you please share the following code snippets (please, remember to redact any sensitive info)?
- The handler for the
ItemSendorOnMessageSendevent where you're callinggetAttachmentContentAsync. - The Vue subcomponent's mount logic (e.g., the
mounted()hook) that triggers the server API call. - Any relevant parts of your main.js where
Office.initialize()is set up.
Once I have these, I can analyze them further. Let me know if you have any questions in the meantime.I am looking forward to your reply.
Please understand that our initial response may not always resolve the issue immediately. However, with your further updates and more detailed information, we can work together to find a resolution.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.