首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Menifest.xml -如何在Office中添加多个菜单类型控件

Menifest.xml -如何在Office中添加多个菜单类型控件
EN

Stack Overflow用户
提问于 2022-04-25 13:06:10
回答 1查看 112关注 0票数 0
代码语言:javascript
复制
Excel Addin is not loading when I add multiple Menu type controls in the Office menu.

我用的是<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">

代码语言:javascript
复制
    <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TaskPaneApp">

    I'm using  `<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">`

    <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TaskPaneApp">


    Menifest.xml file has below OfficeMenu config

            <ExtensionPoint xsi:type="ContextMenu">
                      <OfficeMenu id="ContextMenuCell">
                         <Control xsi:type="Menu" id="TestMenu">
                            <Label resid="prn.TabLabel" />
                            <Supertip>
                               <Title resid="prn.TabLabel" />
                               <Description resid="TaskpaneButton.Tooltip" />
                            </Supertip>
                            <Icon>
                               <bt:Image size="16" resid="Icon.16x16" />
                            </Icon>
                            <Items>
                               <Item id="contextitem1">
                                  <Label resid="RightMenu1.TabLabel" />
                                  <Supertip>
                                     <Title resid="RightMenu1.TabLabel" />
                                     <Description resid="RightMenu1.Tooltip" />
                                  </Supertip>
                                  <Icon>
                                     <bt:Image size="16" resid="Icon.16x16" />
                                  </Icon>
                                  <Action xsi:type="ExecuteFunction">
                                 <FunctionName>openTaskpaneInPopUp</FunctionName>
                               </Action>
                               </Item>
                            </Items>
                         </Control>
                   
                         <Control xsi:type="Menu" id="TestMenu1">
                            <Label resid="prn.TabLabel" />
                            <Supertip>
                               <Title resid="prn.TabLabel" />
                               <Description resid="TaskpaneButton.Tooltip" />
                            </Supertip>
                            <Icon>
                               <bt:Image size="16" resid="Icon.16x16" />
                            </Icon>
                            <Items>
                               <Item id="contextitem1">
                                  <Label resid="RightMenu1.TabLabel" />
                                  <Supertip>
                                     <Title resid="RightMenu1.TabLabel" />
                                     <Description resid="RightMenu1.Tooltip" />
                                  </Supertip>
                                  <Icon>
                                     <bt:Image size="16" resid="Icon.16x16" />
                                  </Icon>
                                  <Action xsi:type="ExecuteFunction">
                                 <FunctionName>openTaskpaneInPopUp</FunctionName>
                               </Action>
                               </Item>
                            </Items>
                         </Control>
                      </OfficeMenu>
                   </ExtensionPoint>
EN

回答 1

Stack Overflow用户

发布于 2022-04-25 14:50:52

首先,确保带状XML标记中使用的所有is都是唯一的。例如,我看到两个控件中使用的ID相同:

代码语言:javascript
复制
<Item id="contextitem1">

默认情况下,如果dd-in试图操作Microsoft用户界面(UI)而失败,则不会显示错误消息。但是,可以将Microsoft应用程序配置为显示与UI相关的错误消息。您可以使用这些消息来帮助确定为什么没有出现自定义带状,或者为什么会出现带状,但没有出现控件。有关详细信息,请参阅如何:显示外接程序用户界面错误

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72000047

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档