【发布时间】:2015-06-15 16:56:37
【问题描述】:
我想在outlook 2010后台捕获“TabPrint”中的点击事件。
Followint 是我目前所做的
我在 xml 中定义了一个自定义 UI,如下所示。我已将每个事件定向到一个方法(即 OnPrintClick)
<?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>
OnPrintClick 方法位于解决方案中的Connect 类中。以下是该方法接受的参数。
public void OnPrintClick(IRibbonControl control , ref bool cancel)
{
MessageBox.Show("PRINT !");
}
当我执行此代码时,它不会捕获我定义的任何点击事件。我在这里做错了什么吗?任何帮助将不胜感激。
【问题讨论】:
标签: outlook outlook-addin outlook-2010 office-addins