3

I have a Sharepoint hosted app that retreive documents from a library and I want that the name of the file has a link to open the document directly to the client Office app. The SP hosted app is made with angular 2 and I am working with REST.

The endpoint i'm using for get the files is:

_spPageContextInfo.siteAbsoluteUrl + "/_api/lists/getbytitle('Documentos')/items?$select=FileRef,Title&$filter=ContentType eq '" + cttypeName + "'";

Is there a property in the file that has that url?

1
+50

You can using the Office URI Schemes in the url, and change the window to it.

window.location.href = "ms-word:ofe|u|https://testing.sharepoint.com/sites/testsite/doculib/Folder/worddocument.docx";

Upon testing, it worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.