Sdílet prostřednictvím


Configure the default open behavior for browser-enabled documents (Office Web Apps)

 

Applies to: Word Web App Preview, PowerPoint Web App Preview, Excel Online

Topic Last Modified: 2011-08-05

Banner stating end of support date for Office 2010 with link to more info

To configure the default open behavior for Microsoft Office Web Apps documents that are installed on Microsoft SharePoint 2010 Products on a stand-alone server or on a server farm, IT Pros should follow the instructions in this article.

"SharePoint 2010 Products," in this article, refers to Microsoft SharePoint Server 2010 and Microsoft SharePoint Foundation 2010 unless otherwise noted.

Configure the default open behavior for documents

In SharePoint, you can configure whether browser-enabled documents are opened in a client application or in the browser. By default, when Office Web Apps is installed, Office documents will open in the browser. You can override this setting using the SharePoint OpenInClient feature. The OpenInClient feature can be configured in site collection administration or by using the SPFeature cmdlet in Windows PowerShell.

How documents open in SharePoint varies depending on whether the OpenInClient feature is present, and either enabled or disabled:

  • If the OpenInClient feature is not present and Office Web Apps is not installed, documents will open in the client application (SharePoint default).

  • If the OpenInClient feature is not present, Office Web Apps is installed and Office Web Apps service applications are activated, documents will open in the browser (Office Web Apps default).

  • If the OpenInClient Feature is present and enabled, and Office Web Apps service applications are activated, documents will open in the client application.

  • If the OpenInClient Feature is present and disabled, and Office Web Apps service applications are activated, documents in will open in the browser.

Warning

When you run Setup.exe to install Office Web Apps, setup will take control of the default open behavior in SharePoint to register Word, PowerPoint, Excel, and OneNote documents to be opened in their associated Web app. If a user clicks on a document in SharePoint after Setup.exe is run, but before the Office Web Apps Services and Feature have been activated, the user can get a broken link in the browser. When installing Office Web Apps in a live production environment, we strongly recommend that you enable the OpenInClient Feature before running Office Web Apps setup.

Note

Configuring the default open behavior for browser-enabled documents will not affect whether users can use Check Out and Send To features in SharePoint to download documents. For information about how to configure check out, download, and view permissions in SharePoint, see Security planning for sites and content (SharePoint Server 2010) and Security planning for sites and content (SharePoint Foundation 2010).

Procedures in this task:

  • To set the default open behavior for site collections

  • To set the default open behavior for site collections by using Windows PowerShell

  • To set the default open behavior for a document library by using the document library settings page

  • To set the default open behavior for IRM protected document libraries by using Windows PowerShell

Some procedures in this task require using Windows PowerShell or SharePoint 2010 Management Shell to run cmdlets. To run SharePoint 2010 cmdlets in Windows PowerShell, you must add the Microsoft.SharePoint.PowerShell snap-in by using the Add-PSSnapin cmdlet, or you can run the SharePoint 2010 cmdlets by using SharePoint 2010 Management Shell. By default, the Microsoft.SharePoint.PowerShell snap-in is already registered, and the snap-in is added to the SharePoint 2010 Management Shell. To run SharePoint 2010 cmdlets, you must be a member of the SharePoint_Shell_Access role on the configuration database and a member of the WSS_ADMIN_WPG local group on the computer where SharePoint 2010 Products is installed. To run scripts in Windows PowerShell or SharePoint 2010 Management Shell, you must set the execution policy by using the set-executionpolicy cmdlet, using the unrestricted parameter. For more information about the Add-PSSnapin cmdlet, see Add-PSSnapin. For more information about how to use Windows PowerShell with SharePoint 2010 Products, see SharePoint 2010 Products administration by using Windows PowerShell.

To set the default open behavior for site collections

  1. In the SharePoint site collection, click Site Actions, and then click Site Settings.

  2. On the Site Settings page, under Site Collection Administration, click Site Collection Features.

  3. On the Features page, for the Open Documents in Client Applications by Default feature, click Activate (OpenInClient Feature is enabled) to open documents in the client application. Click Deactivate (OpenInClient Feature is disabled) to open documents in the browser.

To set the default open behavior for site collections by using Windows PowerShell

  1. Using Notepad, open a new text file and then copy and paste the following script into the file.

    The following example sets the default open behavior for all documents in all sites to open in their associated client application (if available).

    $defaultOpenBehaviorFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq "OpenInClient"}).Id 
    Get-SPSite -limit ALL |foreach{ Enable-SPFeature $defaultOpenBehaviorFeatureId -url $_.URL }
    

    The following example sets the default open behavior for all documents in all sites to open in the browser.

    $defaultOpenBehaviorFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq "OpenInClient"}).Id 
    Get-SPSite -limit ALL |foreach{ Disable-SPFeature $defaultOpenBehaviorFeatureId -url $_.URL }
    
  2. Specify the following parameters:

    Parameter Value

    –limit

    The type must be a valid non-negative number. Specify ALL to return all site collections for the given scope.

  3. Save the file with a .ps1 file name extension to a folder where you run scripts (typically C:\scripts).

  4. In the Windows PowerShell console, at the command prompt (that is, PS C:\>), type the following command and press ENTER:

    C:\<path>\<filename>.ps1

To set the default open behavior for a document library by using the document library settings page

  1. On the <document library>: All Documents page, under Library Tools, click Library.

  2. In the library toolbar, click Library Settings.

  3. On the Document Library Settings page, click Advanced Settings.

  4. On the Advanced Settings page, in Opening Document in the Browser, select one of the following options:

    Open in the client application   When a user clicks on a document in this library, the document will open in the corresponding client application (if available).

    Open in the browser   When a user clicks on a document in this library, the document will open in the Web browser Web app for that document type. When the document is opened in the Web app, the user can then decide to open the document in the client application

    Use the server default   When a user clicks on a document in this library, the document will open by using the default open behavior specified for the server on which SharePoint 2010 Products is installed.

To set the default open behavior for IRM protected document libraries by using Windows PowerShell

  1. Using Notepad, open a new text file and then copy and paste the following script into the file.

    The following example sets the default open behavior for IRM protected document libraries in all sites to open in their associated client application (if available).

    Get-SPWeb -site http://contoso | % {$_.Lists} | where {$_.IrmEnabled -eq $true} | % {$_.DefaultItemOpen =[Microsoft.Sharepoint.DefaultItemOpen]::PreferClient; $_.Update()}
    
  2. Specify the following parameters:

    Parameter Value

    –site

    URL

  3. Save the file with a .ps1 file name extension to a folder where you run scripts (typically C:\scripts).

  4. In the Windows PowerShell console, at the command prompt (that is, PS C:\>), type the following command and press ENTER:

    C:\<path>\<filename>.ps1

See Also

Other Resources

Get-SPWeb
Get-SPSite
Get-SPFeature