How to control how a Office document SharePoint URL would open from a chat line

Dieter Tontsch (GMail) 972 Reputation points
2022-02-14T14:56:53.553+00:00

I have a question regarding how Office document links from SharePoint (on-premises in our case) get opened if one clicks the document url sent via some chat (teams or slack) or email client etc. And this question does not relate to the behavior of how documents open if one clicks the document name in the library from a browser, that can be controlled via site collection, site or library settings, I am aware of this. It is all about one sharing a link via a chat or some other application like Outlook client etc. the problem we have here is that if the link is sent plain, without ?web=1, in Chrome or Firefox the document gets downloaded locally and then gets opened (or not) with the local office all like Word, Excel, PowerPoint etc. But it is the locally stored document and not the server-based one.
Below I have outlined the behavior (mostly related to Chrome as default browser) of the different URL types.

All Browser-related behavior is based on Chrome
ms-word:ofe|u|https://spnt.company.com/mx/it//RiskAnalyses/IT-Risikoanalyse.docx

  • Works as expected inserted directly in address line of a browser or sent as link from e.g. Outlook - however not an option
  • But it doesn't work anyway as link as a whole in Teams or Slack Chat. Both clients either do not understand this as a link at all, or only starting from https:// which leads again to the problem that the document in charge is downloaded instead of open it in default client

https://spnt.company.com/mx/it//RiskAnalyses/IT-Risikoanalyse.docx?web=1

  • always works by opening in Office Online

https://spnt.company.com/mx/it//RiskAnalyses/IT-Risikoanalyse.docx?web=0

  • works as without ?web=0, which means it downloads the document locally
  • works as expected, opens in Client Application from SharePoint in EDGE Browser

Copy Link feature, how it works:
OneDrive: https://company-my.sharepoint.com/:w:/r/personal/first_last_de1/Documents/Appassure%20Backup%20Appliance%20DL%201000.docx?d=wac2ef6fc80eb4dbe9a2e9be5dd357b6b&csf=1&web=1&e=dxp0Cw
SharePoint Online: https://company.sharepoint.com/:w:/r/marketing/Documents/A_Offer.docx?d=w0282065f4f1e4302a155cac0d71364f6&csf=1&web=1&e=PbX1B2
SharePoint on-prem: https://spnt.company.com/mx/it//RiskAnalyses/IT-Risikoanalyse.docx

As long the URL contains the web=1 appendix it always opens in Office Online, but this isn't added in SharePoint on-prem at the copy link url.

However, desired behavior should be that a Office document link from SharePoint shall always open the document form the server location with default action configured, so either in Office Online or in Office application, according to Library, Site or Site Collection setting. Actually, the very same way as if one just clicks the name of the document in the browser. Any chance for this (with Chrome as def. browser application)?

kind regards,
Dieter

Microsoft 365 and Office | SharePoint Server | For business
{count} vote

1 answer

Sort by: Most helpful
  1. Dieter Tontsch (GMail) 972 Reputation points
    2022-02-15T14:19:18.2+00:00

    In the meantime I got even more confused while digging deeper into this issue. It's not just we struggle with the links, it also depends whether one uses classic view or modern experience. Here is part of my findings:

    https://spnt.mobilexag.de/mx/sales/Prospects_Customers/DTo_Test/A_202007-06a.docx --> instantly downloads the document locally

    https://spnt.mobilexag.de/mx/sales/_layouts/15/guestaccess.aspx?guestaccesstoken=5%2bfkNGtON9SivuGLPidvTPpICFXEeGCY%2b5fShDhWqA0%3d&docid=2_15ffd4d04722946768c1eb7a06de83c37&rev=1 --> opens the doc in Office Online on-prem server

    https://mobilexag.sharepoint.com/:w:/r/marketing/Freigegebene%20Dokumente/A_Komplettangebot.docx?d=w0282065f4f1e4302a155cac0d71364f6&csf=1&web=1&e=SCHKTK --> Opens the doc in the Office Online App

    All I can say is that SharePoint Online links open for me in the Office App in browser, they do not get downloaded unless I strip down the link looking the same way as the plain on-prem one does, like e.g. from https://mobilexag.sharepoint.com/:w:/r/marketing/Freigegebene%20Dokumente/A_Komplettangebot.docx?d=w0282065f4f1e4302a155cac0d71364f6&csf=1&web=1&e=SCHKTK to https://mobilexag.sharepoint.com/:w:/r/marketing/Freigegebene%20Dokumente/A_Komplettangebot.docx. In that case behavior is the same and the document just downloads

    Here I found a few threads dealing with how links are created in SharePoint, online and on prem and so on and so forth...:
    https://learn.microsoft.com/en-us/answers/questions/545738/creating-link-to-document-in-sp2019-on-premise.html
    https://cresyl.eu/en/sharepoint/understanding-how-share-links-are-built/
    https://learn.microsoft.com/en-us/answers/questions/158334/why-does-sharepoint-2016-copy-option-only-show-bas.html

    Maybe this helps clarifying my problem.

    kind regards,
    Dieter


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.