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
668 stars 95 forks source link

Add addFileAttachmentAsModernAttachmentAsync and addFileAttachmentAsModernAttachmentFromBase64Async feature #4166

Open pabloglombovsky opened 6 months ago

pabloglombovsky commented 6 months ago

Hi! It is not possible to programmatically add a file as a sharing link in OneDrive or SharePoint. You can do this from the web or even using VSTO (adding the method 7).

I think there should be one function like addFileAttachmentAsModernAttachmentAsync that would basically take 2 parameters: The original URL in the web The sharing method to use and it should visually add the sharing link with all the options like: image

The same with addFileAttachmentAsModernAttachmentFromBase64Async. It should take 2 parameters: The base64 string without any size restriction The sharing method to use

The functions should do the sharing (with the sharing method like AnyoneCanView or the new "AnyoneCanViewWithPassword") and add the sharing link.

Thanks

besiler commented 6 months ago

Hi @pabloglombovsky , thanks for sharing this idea! You mention attachments, so I think you are thinking mostly (or only) about Outlook and not other office apps--is that right?

We are looking at doing some work to better support file storage and sharing in Outlook, so this suggestion is very timely!

Would you mind posting it here in our feature request forum so others can see your suggestion and vote on it? https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform We might also find if others want similar features for other office products as well.

besiler commented 6 months ago

Closing as a feature request -- will put this on the backlog for Outlook file sharing support and monitor https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform for developer feedback on urgency