This article is about “How to set the default open behavior or configure Office files opened by default in SharePoint online” in SharePoint site collection or in document library.
I will explain how we can configure the default open behavior for Office documents (browser or Application) in SharePoint site collections and document libraries.
This solution article applies to SharePoint online, SharePoint Server 2013, SharePoint Foundation 2013, and Office Web Apps.
So, let’s start with small description of how the default document behavior is there in the browser. As we know, we create a document library to store the documents like Word, Excel, PowerPoint etc. After configuring the SharePoint Server, clicking on any of the documents lets it open and the default behavior is set using the Server default, such as - open in browser or open in the Word Web app.
We can change the default behavior in three different ways.
-
SharePoint Farm (we can configure farm based behavior)
-
Site collection (Can be configured on site collection)
-
Document Library (one document library also can be configured for the same)
In the SharePoint Farm, we can configure or adjust the default open behavior of files on a file type basis. For example, Word, Excel, Notebook, and PDF behaviour can be set.
For this, we need to run a command
New-SPWOPIBinding
This command will create a new binding to associate file name extensions or applications with actions on the current SharePoint farm where this cmdlet is run.
The New-SPWOPIBinding cmdlet associates file name extensions or applications to actions on the current SharePoint farm where this cmdlet is run.
Syntax
New-SPWOPIBinding -ServerName "Prashant.spsolutions.com"
Above example creates bindings for all the applications and file name extensions that the WOPI application supports on the current SharePoint farm where this cmdlet is run.
For specific applications, we can run the below command
New-SPWOPIBinding -ServerName "Server.corp.Contoso.com" -Application "Excel"
To learn more about farm based changes for Office file behavior, visit the below URL.
https://technet.microsoft.com/en-us/library/jj219441.aspx
Don’t get confused. Once you have configured the farm based settings for Office files, you can remove the settings whenever you want. For further information, please visit the above URL.
We have another option to change the behavior in the site collection itself
Setup Office file behaviour in Site collection: SP administrators and users can use the OpenInClient feature in SharePoint online or 2013 to specify whether Office (Word, excel etc…) files will be opened in the client application or in the browser. Users (who have permission) can change this setting in the document library properties also for site collection administrators can change it in Site Collection Administration or by using the Enable-SPFeature cmdlet to enable the OpenInClient feature.
Below are the step by step solution with screen shots to the same
Note I am going to perform this on SharePoint Online, same steps will for SharePoint on-premises with some different GUI mode.
-
Login to the SharePoint online site collection with Admin rights.
-
Navigate the page to Site setting by clicking on Gear box on the top of page and Site collection features from site collection Administrator.
-
Now, click on highlighted site collection features and activate Open documents in client application by default.
-
By default, it will be deactivated. So, just click on "Activate" and wait for activation.
We can configure the above by using PowerShell command as well
-
Once entered, hit Enter. It will prompt you for password, enter the password and wait a second.
It will connect your Office 365 site.
Note - Make sure, you have Admin rights to follow the steps, else you will be get access denied or a not authorized error.
The above command is used to activate the feature for one site URL. If you wish to enable the same features for all site URLs, you need to run the below command.
Get-SPSite -limit ALL |foreach{ Enable-SPFeature 8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295 -url $_.URL }
Last but not least, set the default open behavior for a document library by using the document library settings page.
This is very simple to set the behaviour for one particular document library. We can set behavior for Office documents in one document library as well, and it will take effect for all documents available in the same.
-
Here, we can see default, use the server default (open in the browser). So, we need to select another option like "open in the client application"; and save this setting.
-
Now, go back to Library page and open any one document to test if the behaviour is working as expected or not. In my case, I have successfully changed the behaviour.
*Change site collection URL on the colored object.
Thanks.