如何捕捉;“打印”选项卡;单击Outlook 2010后台的事件?

如何捕捉;“打印”选项卡;单击Outlook 2010后台的事件?,outlook,outlook-addin,outlook-2010,office-addins,Outlook,Outlook Addin,Outlook 2010,Office Addins,我想在outlook 2010后台的“TabPrint”中捕获点击事件 下面是我到目前为止所做的 我在xml中定义了一个自定义UI,如下所示。我已将每个事件指向一个方法(即OnPrintClick) 当我执行此代码时,它不会捕获我定义的任何单击事件。我有什么地方做错了吗?任何帮助都将不胜感激。对于后台UI控件,命令标记将不起任何作用。您只能重新调整功能区(而不是后台)上的控件的用途。有关更多信息,请参阅 一个可能的解决方案是考虑隐藏内置的UI并用自定义命令完全重建它。在MSDN的以下系列文章中阅

我想在outlook 2010后台的“TabPrint”中捕获点击事件

下面是我到目前为止所做的

我在xml中定义了一个自定义UI,如下所示。我已将每个事件指向一个方法(即OnPrintClick)


当我执行此代码时,它不会捕获我定义的任何单击事件。我有什么地方做错了吗?任何帮助都将不胜感激。

对于后台UI控件,
命令
标记将不起任何作用。您只能重新调整功能区(而不是后台)上的控件的用途。有关更多信息,请参阅

一个可能的解决方案是考虑隐藏内置的UI并用自定义命令完全重建它。在MSDN的以下系列文章中阅读有关后台UI的更多信息:


谢谢尤金。但是我们怎样才能像以前一样重新编程现有的功能呢?首先看看我在帖子中提到的文章。
 <?xml version="1.0" encoding="utf-8" ?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <commands>    
    <!-- Mail print related -->
    <command idMso="FilePrint" onAction="OnPrintClick"/>
    <command idMso="FilePrintCustomRange" onAction="OnPrintClick"/>
    <command idMso="FilePrintPreview" onAction="OnPrintClick"/>
    <command idMso="FilePrintQuick" onAction="OnPrintClick"/>
    <command idMso="GroupPrint" onAction="OnPrintClick"/>
    <command idMso="GroupPrintPreview" onAction="OnPrintClick"/>
    <command idMso="GroupPrintProtectedView" onAction="OnPrintClick"/>
    <command idMso="GroupPrintSettings" onAction="OnPrintClick"/>
    <command idMso="PrintCategory" onAction="OnPrintClick"/>
    <command idMso="PrintDialogAccess" onAction="OnPrintClick"/>
  </commands>
</customUI>
 public void OnPrintClick(IRibbonControl control , ref bool cancel)
    {
        MessageBox.Show("PRINT !");
    }