When you press F to run the addin this XML markup is passed to Word to display your menu on the Ribbon as shown in Figure

Insert Page Layout References Mailings Review View My Tab Built-InDialogs"^] _] New Document or Template... _] New A Font...

Fi Earagraph... aie Stritethrough labs...

Web Options...

Figure 14.26. A menu of built-in dialog boxes, along with a submenu


A split button combines a button and a menu. You can either click the button or click the arrow to the right of the button to reveal a list of items. In this example, you write XML in the Ribbon1.xml file to represent this control, as shown in Listing 14.15. You must specify one button (or toggleButton) and one menu.

Listing 14.15. Adding a split button to the Ribbon

<splitButton id="MySplitButton" > <button idMso="FontDialog"/> <menu id="SubMenu2" label="Font Attributes" itemSize="normal"> <toggleButton idMso="Bold"/> <toggleButton idMso="Italic"/> <toggleButton idMso="UnderlineDouble"/> <toggleButton idMso="Strikethrough"/> </menu> </splitButton>

If you hold your cursor over the split button, the tool tip displays a thumbnail view of the Font dialog box, as shown in Figure 14.27, and if you click the button, the Font dialog box itself is displayed. When you click the drop-down at the right side of the button, a menu is revealed, as shown in Figure 14.28.

0 0

Post a comment