【问题标题】:why MenuContext is not working in Office Word 2016为什么 MenuContext 在 Office Word 2016 中不起作用
【发布时间】:2020-04-22 15:36:37
【问题描述】:

我正在尝试开发一个 office-js 单词插件来增强右键菜单,但是当我在清单中添加元素时。 Word 无法再读取/访问清单。 所以 OfficeMenu 对我不可用。

我可以检查什么?

非常感谢

<ExtensionPoint xsi:type="ContextMenu">
            <OfficeMenu id="ContextMenuText">
              <Control xsi:type="Menu" id="ContextMenu2">
                <Label resid="CommandGroup.Label"/>
                <Supertip>
                  <Title resid="TaskpaneButton.Label"/>
                  <Description resid="TaskpaneButton.Tooltip"/>
                </Supertip>
                <Icon>
                    <bt:Image size="16" resid="Icon.16x16"/>
                    <bt:Image size="32" resid="Icon.32x32"/>
                    <bt:Image size="80" resid="Icon.80x80"/>
                  </Icon>
                  <Items>
                    <Item id="Item1">
                      <Label resid="IdItem1"/>
                      <Supertip>
                        <Title resid="IdItem1"/>
                        <Description resid="TaskpaneButton.Label"/>
                      </Supertip>
                      <Icon>
                      <bt:Image size="16" resid="Icon.16x16"/>
                      <bt:Image size="32" resid="Icon.32x32"/>
                      <bt:Image size="80" resid="Icon.80x80"/>
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <TaskpaneId>ButtonId1</TaskpaneId>
                      <SourceLocation resid="Taskpane.Url"/>
                    </Action>
                  </Item>
                </Items>
              </Control>
            </OfficeMenu>
          </ExtensionPoint> ```

【问题讨论】:

  • 清单是否有效?见docs.microsoft.com/en-us/office/dev/add-ins/testing/…。另外,Office 无法访问清单是什么意思?出了什么问题以及导致它的步骤是什么?
  • 嗨 Rick,是的,运行 npm run validate 不会给出任何错误,因此清单对命令有效。但是,一旦我想在 Word 中查看结果,我就会收到一条错误消息,指出组件(清单)不存在或已被移动 /deleted 。如果我删除有关菜单的行,那么它会再次起作用。

标签: office-js office-addins office-js-helpers


【解决方案1】:

好的,我认为我发现了错误。

我运行了运行时调试模块,发现问题只是因为拼写错误

以下行 &lt;Label resid="CommandGroup.Label"/&gt; 指的是标签 CommandsGroup.Label 所以我在标签名中缺少 S,这就是模块无法正确加载的原因

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-07
    • 2017-04-05
    • 1970-01-01
    • 1970-01-01
    • 2020-02-11
    • 1970-01-01
    • 2018-10-02
    相关资源
    最近更新 更多