嗨,我正在尝试使用 xml 代码自定义功能区,但选项卡上未显示新选项卡。这是自定义UI的代码.xml:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="customTab" label="Makra">
<group id="customGroup" label="AAA">
<button id="customButton1"
label="SOME LABEL"
imageMso="TableSharePointListsModifyColumnsAndSettings"
size="large"
onAction="BTNA" />
</group>
<group id="customGroup1" label="SOME LABEL 2">
<button id="customButton2"
label="AAA"
imageMso="CacheListData"
size="large"
onAction="BTNB" />
<button id="customButton3"
label="SOME LABEL"
imageMso="DatabaseMoveToSharePoint"
size="large"
onAction="BTNC" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
.rels 文件看起来像这样:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/><Relationship Id="someID" Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="customUI/customUI.xml" /></Relationships>
当我通过添加自定义UI文件夹修改文件并在-rels文件中进行更改时,选项卡没有显示...谁能用这个来打我?还有其他文件必须修改吗?使用自定义UI编辑器,它运行良好,但我不想使用此工具。您认为使用它安全吗?
提前感谢!
有一种更简单的方法可以实现您需要的内容,以防您需要将自定义设置绑定到文件而不是程序(即:仅适用于该文件,而不是每次打开程序时(
希望这就是您正在寻找的。
https://learn.microsoft.com/en-us/office/vba/library-reference/concepts/customize-the-office-fluent-ribbon-by-using-an-open-xml-formats-file