Ability to get shareable URL of the Document, using which other users can Open it online
Currently we can only get the document download URL using Office.content.document.url.
We can kinda convert this URL to open it on online version, if we can split it into 2 parts to something like -
[site URL + Library location]/_layouts/WordViewer.aspx?id=[document path]
This method is tricky because, we don't exactly know, which part of the URL is their site URL and which is the Document path.
Also this solution seems to be sharepoint/onedrive specific.
Also it doesn't take you to the editor page, it goes to an intermediate page where user has to choose to edit in browser or desktop editor.
I think there should be a simple way to get this URL.
Below are few ways in which this can be made available.
- Get the browser URL directly and give it to the add-in.
- Perform the share action programmatically on the document and get the URL generated and give it to the add-in.
- Office URI schemas for opening a document in online version, similar to the ones present to open Word desktop app.