Force Office Files to Open in Desktop App (via link, from web parts.. in all cases)

Copper Contributor

I want to force Office files stored in SharePoint to open in the desktop app - NEVER in Office Online apps. I have configured the site and the Document Library but opening in the native app only seems to work when navigating to the file in the DL and clicking it directly. Web Parts seem to always open the web app, as do links copied via the "Share" or "Copy Link" options in the DL. 

 

I've made up quick video to show and tell: https://youtu.be/SvJd2_TLsmw

 

Note - while I was making the video, I stumbled upon a workaround for when we share links internally via e-mail (and maybe I can use the same workaround when sending files in Teams.)

 

I also fumble through trying to explain what I've been toying with as far as other workarounds.. the limitations of my technical capabilities will be apparent!

 

I already looked at several other posts, e.g.: https://techcommunity.microsoft.com/t5/SharePoint/Creating-a-shareable-document-link-that-forces-a-d...

9 Replies

@wkeber so I am attempting to solve this myself... The only "solution" I have found is using office URI schemes. However, I am very much using quotes around "solution" because, at least in my case, it is not working reliably.

 

See this link for more info → Office URI Schemes 

 

but basically, it is a bit of code in front of your link that forces certain word functions. For example adding "ms-word:ofe|u|" to the front of a link will force the file that is linked (assuming it's a Word doc) to open in word, and specifically in editing mode. There are options for opening in other office apps or in other modes (such as viewing mode, etc). However, the catch I've found is twofold: 

  1. Unless you are pasting this edited link directly into your browser bar, it seems that Microsoft apps often default to each specific user's profile preferences. SO if in Word under Options>Advanced>Link Handling, or in Teams under Settings>Files you would need to allow those apps to open in the desktop app. If they do not have these settings turned on, you cannot force open in desktop apps. 
  2. It sometimes makes the string of text unrecognizable as a link to the program you are using. I am not sure, but this seems to be because most hyperlink software searches for the string "http..." or "https..." at the beginning to be able to identify that string as a link. 

Also, they will only work with "http(s)" links, never "www", etc. 

 

So maybe this will help you, I hope so!

 

Update: I have been able to get this to work reliably now, had to sort out a few bugs elsewhere in my Power Automate flow.

Thanks for sharing - that worked for me today.

@wkeber Thanks much for sharing this. Its quite helpful! In our case, since the problem stems from SharePoint, we opted to turn on the SharePoint "feature," to "Open Documents in Client Applications by Default." We will direct users to the specific library site, and instruct them to select the filename from there. :)

We were trying to get a similar use case to work. We're using a custom forms solution for a list with items that have associated documents. The default Name field for a document library only opens in the browser from the custom form. We ended up creating a new hyperlink column, populating the Url part of the link using Power Automate (in the format of https://domain.sharepoint.com/sites/sitename/libraryname/documentname.fileextension), and turning on the Open Documents in Client Applications by Default site collection feature. This combination seems to be working for us. We couldn't push the Office Uri Schema because Power Automate flows wouldn't successfully validate it as a safe URL.
I think this is the best solution! Well, besides Microsoft Word improving parity between its many versions...

I also created a separate column that appended the URI scheme to the front of the link, and of course, faced the same issue as you that Teams/SharePoint require links placed in a column of type "hyperlink" to begin with "hhtp://" or "https://".

My workaround was to have Power Automate send a link via chat/email to the user. I did this using the Approvals application, which has its own field for inputting a dynamic link in Power Automate. This field does accept URI Schemes.

I realize this isn't a great solution for everyone. In my case, I was unable to mandate the turning on of the "Open Documents in the Client App" setting for all users.

This is what I do, hope it helps others.

 

If you want to take the link and put it in an email, and have that email open directly in the the desktop application, you have to edit two parts of the URL.

 

Using this as an example:

 

https://ustsa.sharepoint.com/:x:/r/teams/TestingEnvironment/Test1/Monday%20Meeting%20Notes/2023/MyEx...

 

Remove the RED areas:

 

https://ustsa.sharepoint.com/:x:/r/teams/TestingEnvironment/Test1/Monday%20Meeting%20Notes/2023/MyExample.xlsx?d=wbaa8a4026e3e4a5f8128b28d39e982eb&csf=1&web=1&e=i65YyG

 

This becomes your new URL that you paste in your email(or whatever):

 

https://ustsa.sharepoint.com/teams/TestingEnvironment/Test1/Monday%20Meeting%20Notes/2023/MyExample....

I'm trying to force Copy Link's to always open in the client app but our link format is like the following:

https://tenancy.sharepoint.com/:w:/s/FC_ICT/EWPW2D3KlLJPnQLS-RFATRsBOo3flwaa9raP2pfKUH7cKQ?e=MCA1mq

The site, library and folder path as well as the file name are missing completely. Nothing like what you've shown.

Anyone have any method to force these links to open in the client app. Ideally a method that does not require end users to mess with the URL.

After  a  lot  of  poking  around , faffing  and reading  on  forums  etc  I think  I've found  such a  simple  way  to do  it 

 

Open file  in  app -  file > Info> Copy path

cathyacbiker_0-1706099169361.png

Paste this  link in to notepad or  something  similar  and  just remove ?web=1 from the  end  of  the  the link. 

 

Now  when  you open the link (excluding ?web=1 at the end) it  opens  in the app and not the browser

 

Hope this  helps  others 

@cathyacbiker 


Just tried the "Copy path" option and removing the "?web=1" in a word document that points to an Excel spreadsheet saved on our Sharepoint site and it still open it in a web page.