配置 PowerPoint 和 Excel 功能区

  1. Home
  2. 资源
  3. 用户手册
  4. 部署指南
  5. 配置 PowerPoint 和 Excel 功能区

think-cell 有许多适用于 PowerPoint 和 Excel 的功能区控件,即选项卡、组和命令。例如,默认 think-cell 功能区选项卡包含 think-cell 控件和内置 Office 控件,这些控件从左到右排列,以反映演示文稿创建 (PowerPoint) 和数据处理 (Excel) 过程。作为管理员,您可以为贵组织中的用户配置 think-cell 控件、内置 Office 控件以及功能区中来自其他加载项的控件。

在 Windows 上,使用组策略配置功能区(请参阅组政策),或在安装过程中使用命令行参数来配置库(请参阅Windows 安装)。

在 Mac 上,使用defaults命令行工具(请参阅macOS 安装)或设备管理解决方案(请参阅macOS 上的托管部署)配置功能区。

使用 .officeUI 文件配置功能区选项卡

仅限 Windows

在 Windows 上,管理员可以使用 .officeUI XML 文件在其组织内配置和部署自定义功能区选项卡。作为管理员,您可以使用 think-cell 控件、内置 Office 控件和来自其他加载项的控件的任意组合来配置 think-cell 功能区选项卡或其他自定义选项卡。若要将功能区自定义为标准用户,请参阅自定义 think-cell 功能区控件

每次打开 PowerPoint 或 Excel 时,think-cell 都会加载 .officeUI 选项卡配置。通常,think-cell 会按原样保留用户所做的功能区自定义,例如,快速访问工具栏和其他功能区选项卡。但是,如果您配置了 think-cell 选项卡,而用户也在 PowerPoint 中自定义了 think-cell 选项卡,则您的配置会覆盖用户所做的自定义。如果用户选择Tools Tools Menu icon > Restore think-cell Tab think-cell 会加载 XML 文件中指定的自定义选项卡,并覆盖任何冲突的用户功能区自定义。

.officeUI 选项卡配置会覆盖默认 think-cell 选项卡的位置和标签配置(请参阅配置默认 think-cell 选项卡的位置和标签)。

若要配置自定义选项卡,请按照以下步骤操作:

  1. 为自定义选项卡创建 XML 文件.
  2. 部署自定义选项卡.

如果您想在功能区中添加多个自定义选项卡,请联系我们的支持团队

为自定义选项卡创建 XML 文件

若要创建用于编码自定义选项卡的 XML 文件,请按照以下步骤操作:

  1. 安装 think-cell 后,打开要自定义选项卡的应用程序,即 PowerPoint 或 Excel。
  2. 右键单击功能区并选择“Customize the Ribbon”。
  3. 在“Customize the Ribbon”中,自定义 think-cell 选项卡或创建新的自定义选项卡。可在Customize the Ribbon列表中找到 think-cell 选项卡,其名称为 think-cell (Custom)。若要创建新的自定义选项卡,请选择“New Tab”。

    选项卡可以包含 think-cell 控件、内置 Office 控件和来自其他加载项的控件的任意组合。若要查看所有 think-cell 功能区命令,请打开Choose commands from下拉菜单并选择Main Tabs。在 Choose commands from 列表的 Main Tabs 中,打开 think-cell Commands > think-cell Commands

    您可以自定义选项卡在功能区的位置、选项卡的 UI 标签和选项卡的控件。如需了解更多信息,请参阅 Microsoft 支持

    完成后,选择“OK”。

  4. 关闭应用程序。
  5. 在文件资源管理器中,分别转到 %AppData%%LocalAppData%,具体取决于 Office 用户自定义是漫游的还是本地的。在 Microsoft\Office 子文件夹中,使用自定义选项卡复制应用程序的 .officeUI 文件,即 PowerPoint.officeUIExcel.officeUI。我们建议重命名复制的文件,例如,重命名为 think-cell.officeUI

如果您自行编写 .officeUI 文件,请务必遵守以下要求:

  • 文件采用标准的自定义 UI XML 格式(请参阅 Microsoft Learn)。
  • 自定义选项卡的 ID 为 ThinkCellTab0

部署自定义选项卡

创建用于编码自定义选项卡的 .officeUI XML 文件后,为所有用户将文件部署到相同路径,例如 C:\Program Files (x86)\think-cell\customizations\think-cell.officeUI。若要加载自定义选项卡,贵组织中的用户在打开 PowerPoint 或 Excel 时必须有权访问 XML 文件。

然后,使用组策略或安装命令行参数指定 XML 文件的路径。路径可以是来自 think-cell 安装文件夹的相对路径,也可以是绝对路径。

组政策

若要使用组策略部署自定义选项卡,请按照以下步骤操作:

  1. 打开要配置的应用程序的 think-cell Tab设置,即 PowerPoint think-cell TabExcel think-cell Tab
  2. 选择“Enabled”。
  3. 在“File path”中,输入 .officeUI 文件的路径,例如 customizations\think-cell.officeUI。请勿用引号括住路径。
  4. 选择“OK”。

若要删除自定义选项卡,请选择“Not Configured”,然后选择“OK”。

安装命令行

若要使用安装命令行参数部署自定义选项卡,请使用参数 RIBBONPPCUSTOMTHINKCELLTAB (PowerPoint) 或 RIBBONXLCUSTOMTHINKCELLTAB (Excel) 运行 think-cell 安装文件。将参数设置为 .officeUI 文件的路径。

例如,若要使用 think-cell 安装文件夹中的 XML 文件 customizations\think-cell.officeUI 在 PowerPoint 中部署自定义选项卡,请使用以下命令行参数:

RIBBONPPCUSTOMTHINKCELLTAB=customizations\think-cell.officeUI

若要删除自定义选项卡,请运行参数设置为 ""think-cell 安装文件。例如,若要从 PowerPoint 中删除选项卡,请使用以下参数:

RIBBONPPCUSTOMTHINKCELLTAB=""

配置默认 think-cell 选项卡的位置和标签

仅限 Windows

在 Windows 上,作为管理员,您可以在 PowerPoint 和 Excel 中配置 think-cell 选项卡的功能区位置和 UI 标签。若要这样做,请在 think-cell 配置参数中指定用于编码所需配置的 XML 属性。

如果您还配置自定义功能区选项卡(请参阅使用 .officeUI 文件配置功能区选项卡),自定义选项卡会覆盖 think-cell 选项卡配置。

若要指定默认 think-cell 选项卡的位置和标签,请使用下表中的配置参数。指定配置参数后,若要将所做的更改更新到功能区,请打开 PowerPoint 或 Excel 并选择“Tools Tools Menu icon > Restore think-cell Tab ”。

指定命令行参数时,用引号 (" ") 括住 XML 代码,用两组引号 ("" "") 括住属性值。例如,在命令行中,将 XML 代码 insertAfterMso="TabHome" 输入为 "insertAfterMso=""TabHome"""

Group policy options

Command-line parameters

Possible attributes

Description

PowerPoint:
PowerPoint think-cell Tab > <tab

Excel:
Excel think-cell Tab<tab

PowerPoint:
RIBBONPPTHINKCELLTABINSERT


Excel:
RIBBONXLTHINKCELLTABINSERT

insertAfterMso, insertBeforeMso

在内置选项卡后面或前面插入 think-cell 选项卡。

insertAfterQ, insertBeforeQ

在另一个自定义选项卡后面或前面插入 think-cell 选项卡。需要声明 XML 命名空间(请参阅使用 idQ 和 xmlns 放置自定义控件)。

label

指定 think-cell 选项卡的 UI 标签。

xmlns:NS_ID

NS_ID替换为命名空间标识符。

为自定义选项卡声明 XML 命名空间(请参阅使用 idQ 和 xmlns 放置自定义控件)。

示例

此示例中的参数配置以下各项:

  • 在 PowerPoint 功能区中插入默认 think-cell 选项卡,使其位于“Home”选项卡后面。
  • 将默认 think-cell 选项卡的标签更改为“My New Tab”。

组政策

若要使用组策略配置此示例,请按照以下步骤操作:

  1. 打开组策略设置 PowerPoint think-cell Tab
  2. 选择“Enabled”。
  3. 在“<tab”中,输入 insertAfterMso="TabHome" label="My New Tab"
  4. 选择“OK”。
  5. 在 PowerPoint 的“Insert”选项卡中,选择Tools Tools Menu icon > Reset think-cell Tab

若要恢复默认 think-cell 选项卡,请按照以下步骤操作:

  1. 在组策略设置 PowerPoint think-cell Tab中,选择“Not Configured”。
  2. 在 PowerPoint 的“Insert”选项卡中,选择Tools Tools Menu icon > Reset think-cell Tab

安装命令行

若要使用安装命令行参数配置此示例,请按照以下步骤操作:

  1. 使用以下参数运行 think-cell 安装文件:
RIBBONPPTHINKCELLTABINSERT="insertAfterMso=""TabHome"" label=""My New Tab"""
  1. 在 PowerPoint 的“Insert”选项卡中,选择Tools Tools Menu icon > Reset think-cell Tab

若要恢复默认 think-cell 选项卡,请按照以下步骤操作:

  1. 使用以下参数运行 think-cell 安装文件:
RIBBONPPTHINKCELLTABINSERT=""
  1. 在 PowerPoint 的“Insert”选项卡中,选择Tools Tools Menu icon > Reset think-cell Tab

启用或禁用 think-cell 选项卡

作为管理员,您可以在 PowerPoint 和 Excel 中启用或禁用 think-cell 选项卡。如果您禁用 think-cell 选项卡,think-cell 还会隐藏“Tools Tools menu icon 菜单中的“Reset think-cell Tab (Windows) 和“Show think-cell Tab (macOS)。

若要启用或禁用 think-cell 选项卡,请使用以下配置参数。

Windows

禁用 think-cell 选项卡

若要在 Windows 上禁用 think-cell 选项卡,请按照以下步骤操作:

  1. 禁止加载 think-cell 选项卡。
  2. 在功能区中删除 think-cell 选项卡。
1. 禁止加载 think-cell 选项卡

您可以使用组策略或安装命令行参数来禁止加载 think-cell 选项卡。

若要使用组策略禁止加载 think-cell 选项卡,请按照以下步骤操作:

  1. 打开要配置的应用程序的 think-cell 选项卡设置,即 PowerPoint think-cell TabExcel think-cell Tab
  2. 选择“Disabled”。
  3. 选择“OK”。

若要使用安装命令行参数禁止加载 think-cell 选项卡,请使用适当的参数运行 think-cell 安装文件:

  • 若要禁用 PowerPoint think-cell 选项卡:RIBBONPPNOTHINKCELLTAB=1
  • 若要禁用 Excel think-cell 选项卡:RIBBONXLNOTHINKCELLTAB=1
2. 在功能区中删除 think-cell 选项卡

若要在功能区删除 think-cell 选项卡,请按照以下步骤操作:

  1. 打开您要禁用其 think-cell 选项卡的应用程序,即 PowerPoint 或 Excel。
  2. 在功能区中右键单击任意空白区域。选择“Customize the Ribbon”。
  3. 在“Customize the Ribbon”中,删除“think-cell (Custom)”选项卡。如需了解更多信息,请参阅 Microsoft Learn
  4. 关闭应用程序。

启用 think-cell 选项卡

若要在 Windows 上启用 think-cell 选项卡,请按照以下步骤操作:

  1. 允许加载 think-cell 选项卡。
  2. 重置 think-cell 选项卡。
1. 允许加载 think-cell 选项卡

您可以使用组策略或安装命令行参数来允许加载 think-cell 选项卡。

若要使用组策略允许加载 think-cell 选项卡,请按照以下步骤操作:

  1. 打开要配置的应用程序的 think-cell 选项卡设置,即 PowerPoint think-cell TabExcel think-cell Tab
  2. 选择“Not Configured”或“Enabled”。
  3. 选择“OK”。

若要使用安装命令行参数允许加载 think-cell 选项卡,请使用适当的参数运行 think-cell 安装文件:

  • 若要启用 PowerPoint think-cell 选项卡:RIBBONPPNOTHINKCELLTAB=0
  • 若要启用 Excel think-cell 选项卡:RIBBONXLNOTHINKCELLTAB=0
2. 重置 think-cell 选项卡

若要重置 think-cell 选项卡,请按照以下步骤操作:

  1. 打开您要启用其 think-cell 选项卡的应用程序,即 PowerPoint 或 Excel。
  2. 在功能区中,转到Insert > think-cell > Tools Tools Menu icon 。选择“Reset think-cell Tab
macOS:

若要在 Mac 上禁用 think-cell 选项卡,请在com.think-cell.settings.ribbonppcom.think-cell.settings.ribbonxl字典中将NoThinkCellTab的布尔值设置为 true

例如,若要使用defaults工具禁用 PowerPoint 中的 think-cell 选项卡,请使用以下命令:

sudo defaults write /Library/Preferences/com.microsoft.office.plist com.think-cell.settings.ribbonpp -dict-add NoThinkCellTab -bool true

若要使用 .plist 文件为设备管理解决方案执行同样的操作,请使用以下代码:

<dict>
	<key>com.think-cell.settings.ribbonpp</key>
	<dict>
		<key>NoThinkCellTab</key>
		<true/>
	</dict>
</dict>

若要启用 think-cell 选项卡,请将“NoThinkCellTab”的布尔值设置为 false

仅在 think-cell 组中显示 think-cell 命令

仅限 Windows

在 PowerPoint 中,think-cell 会向许多功能区选项卡和组添加命令。作为管理员,您可以将内置功能区选项卡中的 think-cell 命令限制为“Insert”选项卡中的单个 think-cell 组。此配置参数不影响 think-cell 选项卡。

组政策

若要使用组策略将 think-cell 命令限制为 think-cell 组,请按照以下步骤操作:

  1. 打开组策略设置 PowerPoint Ribbon
  2. 选择“Enabled”。
  3. 选择“Do Not Touch Built-In Ribbon”。
  4. 选择“OK”。

若要将 think-cell 命令还原到其他功能区选项卡和组,请取消选择“Do Not Touch Built-In Ribbon”。然后选择“OK”。

安装命令行

若要使用安装命令行参数将 think-cell 命令限制为 think-cell 组,请使用参数 RIBBONPPDONOTTOUCHBUILTINRIBBON=1 运行 think-cell 安装文件。

若要将 think-cell 命令还原到其他功能区选项卡和组,请使用参数 RIBBONPPDONOTTOUCHBUILTINRIBBON=0 运行 think-cell 安装文件。

配置 think-cell 组

仅限 Windows

作为管理员,您可以指定显示 think-cell 组的内置或自定义功能区选项卡、组在选项卡中的位置以及组的 UI 标签。

指定命令行参数时,用引号 (" ") 括住 XML 代码,用两组引号 ("" "") 括住属性值。例如,在命令行中,将 XML 代码 idMso="TabHome" 输入为 "idMso=""TabHome"""

如需详细了解如何配置 Office 功能区,请参阅 Microsoft Learn

配置tab元素

若要配置显示 think-cell 组的tab元素,请使用以下配置参数。

Group policy options

Command-line parameters

Possible attributes

Description

PowerPoint:
PowerPoint Ribbon > <tab

Excel:
Excel Ribbon > <tab

PowerPoint:
RIBBONPPTABINSERT

Excel:
RIBBONXLTABINSERT

idMso

在内置选项卡中插入 think-cell 组。

id, idQ

在自定义选项卡中插入 think-cell 组。idQ 需要声明命名空间(请参阅配置 customUI 元素)。

insertAfterMso, insertBeforeMso

在内置选项卡后面或前面插入自定义选项卡。

insertAfterQ, insertBeforeQ

在另一个自定义选项卡后面或前面插入自定义选项卡。需要声明命名空间(请参阅配置 customUI 元素)。

label

指定自定义选项卡的 UI 标签。

如果未指定tab元素的 ididMsoidQ 属性,think-cell 组将显示在“Insert”选项卡中。

示例

此示例中的参数配置以下各项:

  • 在新选项卡中插入 think-cell 组。
  • 将选项卡标记为“My New Tab”。
  • 在内置的“Home”选项卡后面插入新选项卡。

组政策

PowerPoint Ribbon<tab中,输入id="TabNew" label="My New Tab" insertAfterMso="TabHome"

安装命令行

使用以下命令行参数运行 think-cell 安装文件:

RIBBONPPTABINSERT="id=""TabNew"" label=""My New Tab"" insertAfterMso=""TabHome"""

配置group元素

若要配置 think-cell 组的group元素,请使用以下配置参数。

Group policy options

Command-line parameters

Possible attributes

Description

PowerPoint:
PowerPoint Ribbon > <group

Excel:
Excel Ribbon > <group

PowerPoint:
RIBBONPPGROUPINSERT

Excel:
RIBBONXLGROUPINSERT

id, idQ

指定 think-cell 组的标识符。idQ 声明需要命名空间(请参阅配置 customUI 元素)。

insertAfterMso, insertBeforeMso

在内置组后面或前面插入 think-cell 组。

insertAfterQ, insertBeforeQ

在自定义组后面或前面插入 think-cell 组。需要声明命名空间(请参阅配置 customUI 元素)。

label

指定 think-cell 组的 UI 标签

如果您不指定group元素的 ididQ 属性,think-cell 会自动生成 think-cell 组的唯一标识符 (id)。如果您不指定label属性,则组的 UI 标签为 think-cell

示例

此示例中的参数配置以下各项:

  • 在 PowerPoint 的“Home”选项卡中插入 think-cell 组。
  • 在“Font”组后面插入 think-cell 组。
  • think-cell 组的 UI 标签更改为“My New Group”。

组政策

PowerPoint Ribbon中,输入以下内容:

  • 在“<tab”中,输入 idMso="TabHome"
  • 在“<group”中,输入 insertAfterMso="GroupFont" label="My New Group"

安装命令行

使用以下命令行参数运行 think-cell 安装文件:

RIBBONPPTABINSERT="idMso=""TabHome""" RIBBONPPGROUPINSERT="insertAfterMso=""GroupFont"" label=""My New Group"""

配置customUI元素

若要使用属性 idQinsertAfterQinsertbeforeQ,必须声明customUI元素的 XML 命名空间(请参阅使用 idQ 和 xmlns 放置自定义控件)。若要声明命名空间,请在“<customUI”选项的组策略设置 PowerPoint RibbonExcelRibbon中或者使用命令行参数 RIBBONPPXMLNSRIBBONXLXMLNS指定以下值:

xmlns:NAMESPACE_ID="NAMESPACE_URI"

替换以下内容:

示例

此示例中的参数配置以下各项:

  • 使用命名空间标识符 ex 声明 XML 命名空间。
  • 为标记为“My New Tab”的自定义选项卡指定idQ
  • 在内置的“Insert”选项卡后面插入My New Tab
  • think-cell 组指定idQ
  • 在自定义组“ex:GroupCustom”后面插入 think-cell 组。

组政策

PowerPoint Ribbon中,输入以下内容:

  • 在“<customUI”中,输入 xmlns:ex="http://schemas.example.com/customribbon"
  • 在“<tab”中,输入 idQ="ex:TabNew" label="My New Tab" insertAfterMso="TabInsert"
  • 在“<group”中,输入 idQ="ex:GroupThinkCell" insertAfterQ="ex:GroupCustom"

安装命令行

使用以下命令行参数运行 think-cell 安装文件:

RIBBONPPXMLNS="xmlns:ex=""http://schemas.example.com/customribbon""" RIBBONPPTABINSERT="idQ=""ex:TabNew"" label=""My New Tab"" insertAfterMso=""TabInsert""" RIBBONPPGROUPINSERT="idQ=""ex:GroupThinkCell"" insertAfterQ=""ex:GroupCustom"""

配置第二个 think-cell 组

在 PowerPoint 中,将 think-cell 组添加到“Home”选项卡时,可能需要配置第二个 think-cell 组。这是因为 PowerPoint 功能区在常规视图 (TabHome) 中有一个“Home”选项卡,在幻灯片母版视图 (TabSlideMasterHome) 中有一个“Home”选项卡。若要在两个视图的 Home 选项卡中查看 think-cell 组,请在两个选项卡中配置 think-cell 组。

您还可以在 PowerPoint 或 Excel 的任何选项卡中配置第二个 think-cell 组。

若要配置第二个 think-cell 组,请使用以下配置参数。

Group policy options

Command-line parameters

Possible attributes

Description

PowerPoint:
PowerPoint Ribbon > <tab

Excel:
Excel Ribbon > <tab

PowerPoint:
RIBBONPPTABINSERT2

Excel:
RIBBONXLTABINSERT2

请参阅配置 tab 元素

请参阅配置 tab 元素

PowerPoint:
PowerPoint Ribbon > <group

Excel:
Excel Ribbon > <group

PowerPoint:
RIBBONPPGROUPINSERT2

Excel:
RIBBONXLGROUPINSERT2

请参阅配置 group 元素

请参阅配置 group 元素

使用 idQxmlns 放置自定义控件

需要使用限定标识符 (idQ) 才能将来自多个加载项的自定义控件放置在功能区中。例如,若要在自定义选项卡前面或后面放置 think-cell 选项卡(请参阅配置默认 think-cell 选项卡的位置和标签),两个选项卡都应有一个idQ

限定标识符由 XML 命名空间标识符后跟自定义选项卡、组或其他控件的唯一标识符组成。例如,限定标识符 ex:TabCustom 由 XML 命名空间 ex 和唯一标识符 TabCustom 组成。

若要使用限定标识符,必须声明 XML 命名空间。若要声明命名空间,请使用以下代码:

xmlns:NAMESPACE_ID="NAMESPACE_URI"

替换以下内容:

  • NAMESPACE_ID:命名空间标识符,例如 ex
  • NAMESPACE_URI:命名空间 URI,例如 http://schemas.example.com/customribbon

保留自定义控件的位置

如果有多个加载项对功能区进行自定义,则自定义控件可能不会始终显示在相同位置。这是因为 PowerPoint 可能并不总是以相同的顺序加载加载项。在配置 customUI 元素所述的示例中,如果 PowerPoint 在创建组“ex:GroupCustom”的加载项之前加载 think-cell 加载项,则“insertAfterQ="ex:GroupCustom"”将无效。为了确保来自多个加载项的自定义元素始终显示在功能区中的相同位置,在将某个自定义元素放置在相对于另一个自定义元素的位置时,请为两个元素都指定引用另一个元素的位置属性。在配置 customUI 元素所述的示例中,在组“ex:GroupCustom”的 XML 代码中指定“insertBeforeQ="ex:GroupThinkCell"”。