Search code examples
c#ms-officeoffice-2007

How do I add custom menu items to the office-button in office-2007?


How do I add custom menu items to the office-button in office-2007?

In office 2007, I've managed to add some custom menu items to the office button, see the image below:
enter image description here
As you can see I added a 'label' and a 'button'. Though this button lacks some things I would like to see.

What I would like to do is create a button like the 'Word Document' button seen in the picture below. A button with a form of heading and a description underneath it.
enter image description here

I've tried several things, and tried almost every option there was in the 'Ribbon.xml'.

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="Ribbon_Load">
<ribbon>
<officeMenu>
  <menu id="test" label="My Menu">
    <button id="id001" description="desc" enabled="true" label="label" screentip="screentip" supertip="supertip" tag="tag"/>
    <button id="id002" imageMso="AdpPrimaryKey" label="A button" description="desc" onAction="action" visible="true"  />
  </menu>
</officeMenu>
</ribbon>
</customUI>

Solution

  • Maybe you can find some informatie through the ribboneditor on the following site: http://www.andypope.info/vba/ribboneditor.htm

    With the OfficeMenu example you get the following xml:

     <!--RibbonX Visual Designer 1.9 for Microsoft Word 12.0. XML Code produced on 2010/02/02-->
    <customUI  xmlns="http://schemas.microsoft.com/office/2006/01/customui" >
        <ribbon >
            <officeMenu >
                <splitButton  id="Splitbutton1" >
                    <button 
                        id="Button1"
                        imageMso="AdpPrimaryKey"
                        label="Company Lockers"/>
                    <menu 
                        id="Menu1"
                        itemSize="large"
                        label="Menu1">
                        <menuSeparator 
                            id="Menuseparator1"
                            title="Lock away your company files"/>
                        <button 
                            description="Place your workbook in the Corporate Locker. Information may be accessed by others"
                            id="Button2"
                            imageMso="ReviewProtectWorkbook"
                            label="Corporate Locker"/>
                        <button 
                            description="Place your workbook in a Group Locker. Only members of your Group can access it."
                            id="Button3"
                            imageMso="SheetProtect"
                            label="Group Locker"/>
                        <button 
                            description="Place your workbook in a Locker that can only be accessed by users you have invited."
                            id="Button4"
                            imageMso="ProtectDocument"
                            label="Invite Locker"/>
                        <button 
                            description="Place workbook in a Private Locker that can only be accessed by you."
                            id="Button5"
                            imageMso="Lock"
                            label="Private Locker"/>
                    </menu >
                </splitButton >
            </officeMenu >
        </ribbon >
    </customUI >