将分隔符添加到功能区

时间:2016-02-24 03:38:33

标签: ms-word ribbon

我试图在我的MS Word 2010功能区中添加一个分隔符,但我尝试的东西都没有显示出来。我的XML代码不会从Word生成错误消息。言辞无视我的努力。这是我的代码:

    <mso:cmd app="Word" dt="1" />
    <mso:customUI xmlns:x1="http://schemas.microsoft.com/office/2009/07/customui/macro" xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
        <mso:ribbon>
            <mso:tabs>
                <mso:tab id="mso_c1.548D7E1" label="Documents" insertBeforeQ="mso:TabHome">
                    <mso:group id="mso_c1.8A0B6A" label="Series 1" imageMso="FormulaMoreFunctionsMenu" autoScale="true">
                        <mso:button idQ="x1:Open_00_0_987C31" label="00" imageMso="BlackAndWhiteBlackWithWhiteFill" onAction="Open_00" visible="true"/>
                        <mso:button idQ="x1:Open_01_1_987C31" label="01" imageMso="AppointmentColor0" onAction="Open_01" visible="true"/>
                        <mso:button idQ="x1:Open_02_2_987C31" label="02" imageMso="AppointmentColor1" onAction="Open_02" visible="true"/>
                        <mso:button idQ="x1:Open_03_3_987C31" label="03" imageMso="AppointmentColor2" onAction="Open_03" visible="true"/>
                        <mso:button idQ="x1:Open_04_4_987C31" label="04" imageMso="AppointmentColor3" onAction="Open_04" visible="true"/>
                        <mso:button idQ="x1:Open_05_5_987C31" label="05" imageMso="AppointmentColor4" onAction="Open_05" visible="true"/>
                        <mso:button idQ="x1:Open_06_6_987C31" label="06" imageMso="AppointmentColor5" onAction="Open_06" visible="true"/>
                        <mso:button idQ="x1:Open_07_7_987C31" label="07" imageMso="AppointmentColor6" onAction="Open_07" visible="true"/>
                        <mso:button idQ="x1:Open_08_8_987C31" label="08" imageMso="AppointmentColor7" onAction="Open_08" visible="true"/>
                        <mso:button idQ="x1:Open_09_9_987C31" label="09" imageMso="AppointmentColor8" onAction="Open_09" visible="true"/>
                        <mso:button idQ="x1:Open_10_10_987C31" label="10" imageMso="AppointmentColor9" onAction="Open_10" visible="true"/>
                        <mso:button idQ="x1:Open_11_11_987C31" label="11" imageMso="AppointmentColor10" onAction="Open_11" visible="true"/>
                        <mso:button idQ="x1:Open_12_12_987C31" label="12" imageMso="AppointmentBusy" onAction="Open_12" visible="true"/>
                        <mso:button idQ="x1:Open_13_13_987C31" label="13" imageMso="AppointmentColor0" onAction="Open_13" visible="true"/>
                        <mso:button idQ="x1:Open_14_14_987C31" label="14" imageMso="AppointmentColor1" onAction="Open_14" visible="true"/>
                        <mso:button idQ="x1:Open_15_15_987C31" label="15" imageMso="AppointmentColor2" onAction="Open_15" visible="true"/>
                        <mso:button idQ="x1:Open_16_16_987C31" label="16" imageMso="AppointmentColor3" onAction="Open_16" visible="true"/>
                        <mso:button idQ="x1:Open_17_17_987C31" label="17" imageMso="AppointmentColor4" onAction="Open_17" visible="true"/>
                        <mso:button idQ="x1:Open_18_18_987C31" label="18" imageMso="AppointmentColor5" onAction="Open_18" visible="true"/>
                        <separator visible="true"/>
                        <mso:button idQ="x1:Open_Notes_19_987C31" label="Notes" imageMso="BlackAndWhiteAutomatic" onAction="Open_Notes" visible="true"/>
                        <mso:button idQ="x1:Open_Home_20_987C31" label="Home" imageMso="Folder" onAction="Open_IAGFFA_Home" visible="true"/>
                    </mso:group>
                </mso:tab>
            </mso:tabs>
    </mso:ribbon>
    </mso:customUI>

你可以看到我试图在块的末尾附近插入几行代码。

我已经尝试过十几次谷歌搜索来指导我完成这项工作,我甚至尝试过从图书馆购买的一些书籍,但是我在这个非常简单的添加中遇到了这么艰难的时期。留给微软来添加分隔符这么困难的工作。

1 个答案:

答案 0 :(得分:0)

如果使用命名空间声明所有控件,则需要使用/声明它。

 <mso:separator visible="true"/> 

在以下系列文章中阅读有关Ribbon UI(又名Fluent UI)控件的更多信息: