设置启用浏览器功能的文档的默认打开行为(使用 SharePoint 2013 时为 Office Web Apps)Set the default open behavior for browser-enabled documents (Office Web Apps when used with SharePoint 2013) 

适用于: SharePoint Server 2013、SharePoint Foundation 2013、Office Web AppsApplies to: SharePoint Server 2013, SharePoint Foundation 2013, Office Web Apps

摘要: 说明了如何配置 SharePoint 网站集和文档库中的 Office 文档的默认打开行为。Summary: Explains how to configure the default open behavior for Office documents in SharePoint site collections and document libraries.

目标用户: IT 专业人员Audience: IT Professionals

若要打开 SharePoint 2013 文档库中的文档, 只需单击其标题即可。To open a document in a SharePoint 2013 document library, you just click its title. 下一步操作 (文件是在客户端应用程序中打开还是在浏览器中打开) 取决于多个因素, 例如文件的类型、设置 Office Web Apps Server 场的方式, 以及如何设置库或网站 c 的 OpenInClient 功能设置ollection.What happens next (whether the file opens in a client application or in the browser) depends on several factors, such as what type of file it is, how you’ve set up your Office Web Apps Server farm, and how you’ve set the OpenInClient feature settings of the library or site collection. 下面的步骤演示如何配置将 SharePoint 2013 配置为使用 Office Web Apps Server 的 Office 文档的默认打开行为。The following steps show how to configure the default open behavior for Office documents where you have SharePoint 2013 configured to use Office Web Apps Server.

设置如何从 SharePoint 2013 库中打开文档Set how documents are opened from SharePoint 2013 libraries

默认情况下, 在将 SharePoint 2013 配置为使用 Office Web Apps Server 后, 单击 Word、PowerPoint、Excel 或 OneNote 文件将在浏览器中打开它。By default, after you configure SharePoint 2013 to use Office Web Apps Server, clicking a Word, PowerPoint, Excel, or OneNote file opens it in the browser. PDF 文档在 Word Web App 中打开。PDF documents open in the Word Web App. 有两种方式可以更改默认行为,从而允许在客户端应用程序(或者默认 PDF 阅读器)中打开文件:There are two ways to change the default behavior so that files open in the client applications (or the default PDF reader) instead:

  • 对于 sharepoint 2013 服务器场   , 可以使用remove-spwopibindingremove-spwopibinding Windows PowerShell cmdlet 根据每个文件类型为 sharepoint 2013 场调整默认打开行为。For the SharePoint 2013 farm   You can adjust the default open behavior on a per-file-type basis for the SharePoint 2013 farm by using the New-SPWOPIBinding and Set-SPWOPIBinding Windows PowerShell cmdlets. 这些 cmdlet 还可用于调整 PDF 文档的行为These cmdlets can also be used to adjust the behavior of PDF documents.

  • 在网站集或文档库   中, 网站集管理员和用户可以使用 SharePoint 2013 中的 OpenInClient 功能指定是在客户端应用程序中还是在浏览器中打开 Office 文件。In site collections or document libraries   Site collection administrators and users can use the OpenInClient feature in SharePoint 2013 to specify whether Office files will be opened in the client application or in the browser. 用户可以在文档库属性中更改此设置,而网站集管理员可以在网站集管理中更改此设置,也可以使用 Enable-SPFeature cmdlet 启用 OpenInClient 功能。Users can change this setting in the document library properties, and site collection administrators can change it in Site Collection Administration or by using the Enable-SPFeature cmdlet to enable the OpenInClient feature. 参阅下一节,获取多种不同的启用 OpenInClient 功能的方法。See the next section for several different methods to enable the OpenInClient feature.

通常情况下, OpenInClient 功能会覆盖您在 SharePoint 2013 和 Office Web Apps Server 之间设置的所有 WOPI 绑定。In general, the OpenInClient feature overrides any WOPI bindings you’ve set between SharePoint 2013 and Office Web Apps Server. 换言之, 如果启用了 SharePoint 2013 库或网站集的 OpenInClient 功能, 则即使您已将 SharePoint 2013 服务器配置为使用 Office Web Apps Server, 文档也会在客户端应用程序中打开。In other words, if the OpenInClient feature of a SharePoint 2013 library or site collection is enabled, documents will open in the client application even if you've configured the SharePoint 2013 server to use Office Web Apps Server.

备注

配置启用浏览器功能的文档的默认打开行为不会影响用户是否可以使用 SharePoint 2013 中的 "签出" 和 "发送到" 功能下载文档。Configuring the default open behavior for browser-enabled documents won’t affect whether users can use the Check Out and Send To features in SharePoint 2013 to download documents. 有关如何在 SharePoint 2013 中配置签出、下载和查看权限的信息, 请参阅sharepoint 2013 中的网站和内容的权限规划For information about how to configure check out, download, and view permissions in SharePoint 2013, see Permissions planning for sites and content in SharePoint 2013.

设置文档库或网站集的 OpenInClient 功能Set the OpenInClient feature for a document library or site collection

使用以下过程之一在 SharePoint 2013 中设置 OpenInClient 功能。Use one of the following procedures to set the OpenInClient feature in SharePoint 2013.

备注

其中一些过程使用 SharePoint 2013 命令行管理程序来运行 SharePoint cmdlet。Some of these procedures use the SharePoint 2013 Management Shell to run SharePoint cmdlets. 如果您选择使用 Windows PowerShell 控制台, 则必须通过使用PSSnapin Cmdlet 添加 Microsoft SharePoint 管理单元。If you choose to use the Windows PowerShell console, you must add the Microsoft.SharePoint.PowerShell snap-in by using the Add-PSSnapin cmdlet. 有关如何将 Windows PowerShell 与 SharePoint 2013 一起使用的详细信息, 请参阅使用 Windows powershell 管理 sharepoint 2013For more information about how to use Windows PowerShell with SharePoint 2013, see Use Windows PowerShell to administer SharePoint 2013.

备注

您可以使用鼠标、键盘快捷方式或触控来完成 Office 2013 套件中的任务。You can complete tasks in Office 2013 suites by using a mouse, keyboard shortcuts, or touch. 有关如何使用键盘快捷方式和与 Office 产品和服务接触的信息, 请参阅键盘快捷方式office 触摸指南For information about how to use keyboard shortcuts and touch with Office products and services, see Keyboard Shortcuts and Office Touch Guide.

设置网站集的 OpenInClient 功能Set the OpenInClient feature for site collections

  1. 在 SharePoint 网站集中, 选择 "设置" 图标> "网站设置"。In the SharePoint site collection, choose the Settings icon > Site Settings.

  2. 在“网站设置”**** 页的“网站集管理”**** 下,选择“网站集功能”****。On the Site Settings page, under Site Collection Administration, choose Site Collection Features.

  3. 在“功能”**** 上,对“默认情况下,在客户端应用程序中打开文档”**** 功能选择“激活”**** 启用 OpenInClient 功能(文档将在客户端应用程序中打开)或选择“停用”**** 以禁用 OpenInClient 功能(文档将在浏览器中打开)。On the Features page, for the Open Documents in Client Applications by Default feature, choose Activate to enable the OpenInClient feature (documents will open in the client application), or Deactivate to disable the OpenInClient feature (documents will open in the browser).

使用 Windows PowerShell 设置网站集的默认打开行为Set the default open behavior for site collections by using Windows PowerShell

  1. 首先,确保您具有以下成员身份:First, make sure you have the following memberships:

    • SQL Server 实例上的 securityadmin 固定服务器角色。securityadmin fixed server role on the SQL Server instance.

    • 要更新的所有数据库上的数据库**_所有者**固定数据库角色。db_owner fixed database role on all databases that are to be updated.

    • 运行 Windows PowerShell cmdlet 的服务器上的 Administrators 组。Administrators group on the server on which you are running Windows PowerShell cmdlets.

    此外, 请查看有关执行_策略_的内容, 并添加任何其他所需的成员资格。Also, take a look at about_Execution_Policies and add any other required memberships.

    管理员可使用 Add-SPShellAdmin cmdlet 来授予使用 SharePoint 2013 cmdlet 的权限。An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

    备注

    如果你没有权限, 请与安装管理员或 SQL Server 管理员联系以请求这些权限。If you don’t have permissions, contact your Setup administrator or SQL Server administrator to request them. 有关 Windows PowerShell 权限的其他信息, 请参阅权限外接程序 add-spshelladminFor additional information about Windows PowerShell permissions, see Permissions and Add-SPShellAdmin.

  2. 打开提升的 SharePoint 2013 命令行管理程序:Open an elevated SharePoint 2013 Management Shell:

    在 Windows Server 2008 中打开In Windows Server 2008

    1. 在“开始”**** 菜单上,选择“所有程序”****。On the Start menu, select All Programs.

    2. 选择“Microsoft SharePoint 2013 产品”****。Select Microsoft SharePoint 2013 Products.

    3. 选择“SharePoint 2013 命令行管理程序”**** 并显示快捷菜单(右键单击)。Choose SharePoint 2013 Management Shell and display the shortcut menu (right-click).

    4. 从快捷菜单中选择“以管理员身份运行”****。From the shortcut menu, choose Run as administrator.

    在 Windows Server 2012 中打开In Windows Server 2012

    1. 从屏幕边缘向内轻扫以显示超级按钮,选择“搜索”**** 以查看计算机上安装的所有应用程序。Swipe in from the edge of the screen to show the charms and choose Search to see all the applications that are installed on the computer.

    2. 选择(右键单击)“SharePoint 2013 命令行管理程序”**** 以显示应用程序栏。Choose (right-click) SharePoint 2013 Management Shell to display the app bar.

    3. 在应用程序栏中,选择“以管理员身份运行”****。In the app bar, select Run as administrator.

  3. 在 Windows PowerShell 命令提示符处,键入以下命令之一:At the Windows PowerShell command prompt, type one of the following commands:

    • 要为特定网站集启用 OpenInClient 功能(在客户端应用程序中打开文档),请键入以下命令:To enable the OpenInClient feature for a specific site collection (to open documents in the client application), type this command:
          Enable-SPFeature 8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295 -url <SiteCollURL>
    
    where \<SiteCollURL\> is the URL of the site collection.
    
    • 要为所有网站集启用 OpenInClient 功能(在客户端应用程序中打开文档),请键入以下命令:To enable the OpenInClient feature for all site collections (to open documents in the client application), type this command:
          Get-SPSite -limit ALL |foreach{ Enable-SPFeature 8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295 -url $_.URL }
    
    • 要为特定网站集禁用 OpenInClient 功能(在浏览器中打开文档),请键入以下命令:To disable the OpenInClient feature for a specific site collection (to open documents in the browser), type this command:
          Disable-SPFeature 8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295 -url <SiteCollURL>
    
    where \<SiteCollURL\> is the URL of the site collection.
    
    • 要为所有网站集禁用 OpenInClient 功能(在浏览器中打开文档),请键入以下命令:To disable the OpenInClient feature for all site collections (to open documents in the browser), type this command:
          Get-SPSite -limit ALL |foreach{ Disable-SPFeature 8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295 -url $_.URL }
    

使用文档库设置页设置文档库的默认打开行为Set the default open behavior for a document library by using the document library settings page

  1. 在文档库页上,选择“库”**** 选项卡。On the document library page, choose the Library tab.

  2. 在“设置”**** 组中,选择“库设置”****。In the Settings group, choose Library Settings.

  3. 在“文档库设置”**** 页上,选择“高级设置”****。On the Document Library Settings page, choose 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 chooses a document in this library, the document will open in the corresponding client application if it's available.

    • 在浏览器   中打开当用户在此库中选择文档时, 文档将在该文档类型的 web 应用程序中的 web 浏览器中打开。Open in the browser   When a user chooses a document in this library, the document will open in the web browser in the web app for that document type. 当文档在 Web 应用程序中打开时,用户可以决定在客户端应用程序中打开文档。When the document is opened in the web app, the user can then decide to open the document in the client application.

    • 使用服务器默认值   当用户在此库中选择文档时, 文档将使用为运行 SharePoint 2013 的服务器指定的默认打开行为打开。Use the server default   When a user chooses a document in this library, the document will open by using the default open behavior specified for the server running SharePoint 2013.

用 Windows PowerShell 设置受 IRM 保护的文档库的默认打开行为Set the default open behavior for IRM-protected document libraries by using Windows PowerShell

  1. 首先,确保您具有以下成员身份:First, make sure you have the following memberships:

    • SQL Server 实例上的 securityadmin 固定服务器角色。securityadmin fixed server role on the SQL Server instance.

    • 要更新的所有数据库上的数据库**_所有者**固定数据库角色。db_owner fixed database role on all databases that are to be updated.

    • 运行 Windows PowerShell cmdlet 的服务器上的 Administrators 组。Administrators group on the server on which you are running Windows PowerShell cmdlets.

    此外, 请查看有关执行_策略_的内容, 并添加任何其他所需的成员资格。Also, take a look at about_Execution_Policies and add any other required memberships.

    管理员可使用 Add-SPShellAdmin cmdlet 来授予使用 SharePoint 2013 cmdlet 的权限。An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

    备注

    如果你没有权限, 请与安装管理员或 SQL Server 管理员联系以请求这些权限。If you don’t have permissions, contact your Setup administrator or SQL Server administrator to request them. 有关 Windows PowerShell 权限的其他信息, 请参阅权限外接程序 add-spshelladminFor additional information about Windows PowerShell permissions, see Permissions and Add-SPShellAdmin.

  2. 打开提升的 SharePoint 2013 命令行管理程序:Open an elevated SharePoint 2013 Management Shell:

    在 Windows Server 2008 中打开In Windows Server 2008

    1. 在“开始”**** 菜单上,选择“所有程序”****。On the Start menu, select All Programs.

    2. 选择“Microsoft SharePoint 2013 产品”****。Select Microsoft SharePoint 2013 Products.

    3. 选择“SharePoint 2013 命令行管理程序”**** 并显示快捷菜单(右键单击)。Choose SharePoint 2013 Management Shell and display the shortcut menu (right-click).

    4. 从快捷菜单中选择“以管理员身份运行”****。From the shortcut menu, choose Run as administrator.

    在 Windows Server 2012 中打开In Windows Server 2012

    1. 从屏幕边缘向内轻扫以显示超级按钮,选择“搜索”**** 以查看计算机上安装的所有应用程序。Swipe in from the edge of the screen to show the charms and choose Search to see all the applications that are installed on the computer.

    2. 选择(右键单击)“SharePoint 2013 命令行管理程序”**** 以显示应用程序栏。Choose (right-click) SharePoint 2013 Management Shell to display the app bar.

    3. 在应用程序栏中,选择“以管理员身份运行”****。In the app bar, select Run as administrator.

  3. 在 Windows PowerShell 命令提示符处, 键入以下命令:At the Windows PowerShell command prompt, type this command:

      Get-SPWeb -site <SiteCollURL> | % {$_.Lists} | where {$_.IrmEnabled -eq $true} | % {$_.DefaultItemOpen =[Microsoft.Sharepoint.DefaultItemOpen]::<DefaultItemOpenSetting>; $_.Update()}
    

    其中:where:

    • <SiteCollURL>是文档库所在的网站集的 URL。<SiteCollURL> is the URL of the site collection where the document libraries reside.

    • <DefaultItemOpenSetting>是一个DefaultItemOpen枚举值, 用于指定默认打开行为。<DefaultItemOpenSetting> is a DefaultItemOpen enumeration value that specifies the default open behavior. 使用 PreferClient 在关联的客户端应用程序(如果可用)中打开文档。Use PreferClient to open documents in their associated client applications (if available). 使用 Browser 在浏览器中打开文档。Use Browser to open documents in the browser.

另请参阅See also

Get-SPWOPIBindingGet-SPWOPIBinding

Office Web Apps Server 内容指南Content roadmap for Office Web Apps Server
使用 Windows Powershell 管理 SharePoint 2013Use Windows PowerShell to administer SharePoint 2013
Office Web Apps ServerOffice Web Apps Server

Get-SPWebGet-SPWeb
Get-SPSiteGet-SPSite
Get-SPFeatureGet-SPFeature