Tab&中存在问题上下文菜单 [英] there is issue in Tab & Context menu

查看:70
本文介绍了Tab&中存在问题上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建了  Ribbon Tab&一个MailItem上下文菜单使用XML设计器,时间都没有显示。

when i created  Ribbon Tab & one MailItem Context menu using XML designer that time both are not displaying.

如果我使用Designer& amp;创建功能区选项卡。使用XML的上下文菜单,即时间功能区选项卡正在运行但上下文菜单未显示。

if i create  the Ribbon tab using Designer & Context Menu using XML that  time Ribbon  Tab is working but Context menu not showing.

如果我覆盖下面的方法,那么时间选项卡不显示&内容菜单正在运行。

if i override  below metho that time tab is not display & content menu is working.

  protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()

  {

     返回新功能区();

  }

 protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
  {
      return new Ribbon();
  }

我如何实现两个功能区选项卡&& ;; MailItem上下文菜单。

How can i achieve both Ribbon Tab  & MailItem context Menu.

推荐答案

您好,

无法同时使用Designer和XML。由于您要自定义只能通过XML自定义的内容菜单,因此我们需要使用XML来自定义选项卡和内容菜单。 Outlook有许多功能区界面,我们需要指定其功能区ID。  Y ou
可以获得更多信息关于从   扩展
用户Outlook 2010中的界面

Designer and XML could not be used at same time. Since you want to customize content menu which could only be customized by XML, we need to use XML to customize the Tab and content menu. Outlook has many Ribbon interfaces, we need to specify its Ribbon ID. You could get more information about customizing content menus from  Extending the User Interface in Outlook 2010

以下是示例。

public string GetCustomUI(string ribbonID)
        {
            if (ribbonID == "Microsoft.Outlook.Explorer")
                return GetResourceText("OutlookAddIn1.RibbonExplorer.xml");
            else if (ribbonID == "Microsoft.Outlook.Mail.Read")
                return GetResourceText("OutlookAddIn1.RibbonReadMail.xml");
            return null;
        }

在RibbonExplorer.xml中,我自定义了上下文菜单:

In RibbonExplorer.xml, I customized the context menu:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <contextMenus>
    <contextMenu idMso="ContextMenuMailItem">
      <button id="MyContextMenu"
          label="CustomContextMenu"/>
    </contextMenu>
  </contextMenus>
</customUI>

在RibbonReadMail.xml中,我自定义了标签:

In RibbonReadMail.xml, I customized the tab:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns">
        <group id="MyGroup"
               label="My Group">
          <button id="MyButton" label="CustomButton"/>
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

所以我们可以看到

问候,

Celeste


这篇关于Tab&amp;中存在问题上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆