excel 使用Manifest.xml对OfficeMenu子菜单项进行分组

tf7tbtn2  于 2023-06-25  发布在  其他
关注(0)|答案(1)|浏览(110)

我正在尝试使用OfficeJS为Excel构建Webaddin。
我在OfficeJS文档中找不到任何符合我要求的东西。

我的要求是对多个子菜单项进行分组或区分。

就像下面的图片

第一张图片


第二张图片

这就是我的右键单击上下文菜单看起来像多个子菜单项

第三张图片

我想再添加几个子菜单,将子菜单1和子菜单2分组为组1,将子菜单3和子菜单4分组为组2。

我想显示第1组和第2组的标题就像'粘贴选项:'在第一张图片或显示一个线分开2组像在第二张图片。
这是我的清单文件中右键单击上下文菜单的代码

<ExtensionPoint xsi:type="ContextMenu">
                      <OfficeMenu id="ContextMenuCell">
                        <Control xsi:type="Menu" id="Menu">
                                            <Label resid="Dropdown.Label" />
                                            <Supertip>
                                                <Title resid="Dropdown.Label" />
                                                <Description resid="Dropdown.Tooltip" />
                                            </Supertip>
                                            
                                            <Items>
                                                <Item id="Menu.Item1">
                                                    <Label resid="Item1.Label"/>
                                                    <Supertip>
                                                        <Title resid="Item1.Label" />
                                                        <Description resid="Item1.Tooltip" />
                                                    </Supertip>
                                                    
                                                <Action xsi:type="ExecuteFunction">
                                                    <FunctionName>signOff</FunctionName>
                                                </Action>
                                           <Enabled>false</Enabled>
                                                </Item>
                                                <Item id="Menu.Item2">
                                                <Label resid="Item2.Label"/>
                                                <Supertip>
                                                    <Title resid="Item2.Label" />
                                                    <Description resid="Item2.Tooltip" />
                                                </Supertip>
                                                
                                           <Action xsi:type="ExecuteFunction">
                                                <FunctionName>signOff2</FunctionName>
                                            </Action>
                                            </Item>
                            
                                            </Items>
                                        </Control>
                      </OfficeMenu>
                  </ExtensionPoint>
0g0grzrc

0g0grzrc1#

OfficeMenu定义了要添加到Office上下文菜单的控件集合。听起来你需要为你的项目定义几个上下文菜单:

<OfficeMenu id="ContextMenuCell">
   <Control xsi:type="Menu" id="FirstMenu">
      <Items>
       ...
      </Items>
   </Control>

   <Control xsi:type="Menu" id="SecondMenu">
       <Items>
        ...
       </Items>
   </Control>
</OfficeMenu>

相关问题