如何将自定义菜单项添加到 office-2007 中的 office-button?

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

如何将自定义菜单项添加到 office-2007 中的 office-button?

在 office 2007 中,我成功地为 office 按钮添加了一些自定义菜单项,如下图所示:

如您所见,我添加了一个 'label' 和一个 'button'。 虽然这个按钮缺少一些我想看到的东西。

我想做的是创建一个按钮,如下图所示 'Word Document' 按钮。带有标题形式和下方说明的按钮。

我已经尝试了几种方法,并且几乎尝试了 '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>

您可以使用鼠标重新排列和更改工具栏按钮、菜单和菜单命令,也可以使用“重新排列命令”对话框,您可以使用键盘访问该对话框。您可以使用键盘完成的任务被标识为(键盘可访问)。 Check this out to find more

也许您可以通过以下站点上的功能区编辑器找到一些信息:http://www.andypope.info/vba/ribboneditor.htm

使用 OfficeMenu 示例,您将得到以下内容 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 >