9

I need to send users a link to a document in via email, where clicking the link should open the document in the client application, not the browser.

I have already configured the library to open documents in the client application, and this works fine when clicking on the file in the library. However, using the "copy a link" button to get a link to the file and pasting it into a new browser tab opens the file in the browser, not the client.

  • 4
    You could try to format the copied URL like this: ms-word:ofe|u|DOCURL.doc. This works for <a> tags. Since eMails are essentially html this should work for you too. – Mx. Jun 28 '17 at 13:41
12

Mx had the right answer, but I wanted to post the full solution and a few more details in case anyone else is trying to do this:

If you use the "copy url" feature in the library, you get a url like this (depending on the options selected):

https://someurl.sharepoint.com/sites/site1/_layouts/15/DocIdRedir.aspx?ID=TAKVH6VDTJ5Q-572621523-17

From my testing, the above never opens in the client.

However, the following will open in the client:

https://someurl.sharepoint.com/sites/site1/Shared%20Documents/WordDoc1.docx

Mx suggested using the following:

ms-word:ofe|u|https://someurl.sharepoint.com/sites/site1/Shared%20Documents/WordDoc1.docx

This seems to work even smoother, as the one above will prompt the user, asking them if they want to open the file, while Mx's url just opens immediately. I'm sure there are security implications with this, so test accordingly.

Of course, the one drawback with this is that there is nothing in the GUI that I'm aware of that allows us to get these urls, and they will have to be created manually.

1

"...there is nothing in the GUI that I'm aware of that allows us to get these urls, and they will have to be created manually."

I use the 'export to excel' for the library which then provides the direct link for each document in the library. I too wish there was an easier way.

1

Adding to Mike2500's answer (as an answer since I can't comment yet):

Of course, the one drawback with this is that there is nothing in the GUI that I'm aware of that allows us to get these urls, and they will have to be created manually.

Indeed there is a way to derive the direct link to a sharepoint-hosted document: When you open the file in the local client, and then navigate to File => Info, there's a button labeled "Copy path". Clicking that will copy the exact path to your clipboard.

enter image description here

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.