Shawn V. Wilson
Shawn V. Wilson

Reputation: 1111

Can't add ToggleButton to custom Ribbon

Using the excellent Office RibbonX Editor, I've created a custom tab for the Ribbon in Word. I used code like this to add existing commands to it:

        <button idMso="FileSave" />
        <button idMso="FileSaveAs" />
        <button idMso="Bold" />

The first two icons appear as desired, and they work correctly. But the "Bold" button does not appear, neither the icon nor the label. I determined that this happens only for ToggleButtons such as "Bullets" or "Superscript".

Upvotes: 0

Views: 94

Answers (1)

freeflow
freeflow

Reputation: 4355

The correct term for a toggle button is

<toggleButton

as can be seen in the following xml which rebuilds the Paragraph tab in Word after I've made the original not visible

<!-- Recreate the portions of the Paragraph tab that we actually need -->
            <group 
                id="Home.Paragraphs" 
                label="Paragraph" 
                getVisible="RibbonCallbacksForVisibility.getVisible" 
                insertBeforeMso="GroupEditing">

                <box 
                    id="Home.Paragraph.Status"
                    boxStyle="horizontal">
                    <buttonGroup 
                        id="Home.Paragraph.Alignment">
                        <toggleButton idMso="AlignLeft"/>
                        <toggleButton idMso="AlignCenter"/>
                        <toggleButton idMso="AlignRight"/>
                        <toggleButton idMso="AlignJustify"/>    
                    </buttonGroup>

                    <buttonGroup 
                        id="Home.Paragraph.Marks"
                        visible="true">
                        <toggleButton idMso="ParagraphMarks"/>
                    </buttonGroup>

                </box>

                <box 
                    id="ParagraphIndent"
                    boxStyle="horizontal">
                    <button idMso="IndentDecreaseWord"/>
                    <button idMso="IndentIncreaseWord"/>
                </box>

                <box 
                    id = "ParagraphOther"
                    boxStyle="horizontal">
                    <gallery idMso="LineSpacingGallery"/>
                    <button idMso="SortDialogClassic"/>
                </box>

                <dialogBoxLauncher>
                    <button idMso="ParagraphDialog"/>
                </dialogBoxLauncher>

            </group>

Upvotes: 1

Related Questions