0

我正在使用NetOffice开发一个 MS Outlook 插件,并且我想在日历中添加一个自定义上下文菜单项,以允许用户在选定的时间范围内添加一个新的自定义约会。

因此,正如本文中所写,我在 RibbonUI.xml 中定义了我的附加项目,如下所示:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnLoadRibonUI">
  <ribbon>
    <tabs>
      <tab idMso="TabAppointment">
        <group id="Group0" label="Addin" insertBeforeMso="GroupShow">
          <button id="convertButton" label="Convert" getImage="ConvertImage" size="large" onAction="ConvertButton_Click" />
        </group>
      </tab>
      <tab idMso="TabCalendar">
        <group id="Group1" label="Addin" insertBeforeMso="GroupGoto">
          <button id="aboutButton" label="New Custom Meeting" getImage="GetNewImage" size="large" onAction="NewMeetingButton_Click" />
          <dialogBoxLauncher>
            <button id="settingsButton" screentip="Addin Settings" onAction="SettingsButton_Click"/>
          </dialogBoxLauncher>
        </group>
      </tab>
    </tabs>
  </ribbon>
  <contextMenus>    
      <contextMenu idMso="ContextMenuCalendarView">
          <button id="MyContextMenuCalendarView" 
              label="ContextMenuCalendarView" 
              onAction="OnMyButtonClick"/>
      </contextMenu>  
  </contextMenus>
</customUI>

但是一旦我添加了<contextMenus>节点,xml就不再工作了,不是插件没有添加任何上下文菜单,但它也不再添加任何按钮 - 而当<contextMenus>节点没有添加按钮时定义。任何提示如何调试此问题?

编辑:

感谢 Dmitry 的提示,我发现xmlns命名空间是一个旧的问题,所以不是:

xmlns="http://schemas.microsoft.com/office/2006/01/customui" 

它应该是:

xmlns="http://schemas.microsoft.com/office/2009/07/customui"
4

1 回答 1

2

我看不出有什么问题,但是在 Outlook 中启用开发模式 - 这样 Outlook 将报告您 XML 中的所有问题。单击File | Options | Advanced | Developers | Show add-in user interface errors

于 2016-01-06T01:20:14.263 回答