0
在我的Outlook加载项中,我最初为检查器分配了一个自定义功能区(带控件的新组),以支持手动创建的某些邮件的某些功能。当我打开每个邮件项目而不管商店或文件夹时,此自定义选项卡正在显示。我想让此选项卡仅对我手动创建的自定义邮件项目的检查员可见。更改检查器自定义功能区控件dynamiccaly
以下是我添加为代码中检查器的自定义用户界面的xml片段。我添加了一个回调方法来执行以设置可见性(GetCustomGroupVisible)。
<ribbon>
<tabs>
<tab idMso="TabReadMessage">
<group id="MyCustomGroup" insertBeforeMso="GroupMailDelete" getVisible="GetCustomGroupVisible">
<button id="Button1" size="large" onAction="ButtonClick" />
<button id="Button2" size="large" onAction="ButtonClick" />
</group>
</tab>
</tabs>
</ribbon>
// Callback method
public bool GetCustomGroupVisible(IRibbonControl control)
{
bool makeVisible = false;
if (// this is one of my custom mails !)
{
makeVisible = true;
}
return makeVisible;
}
我的问题是,上面所示的回调方法“GetCustomGroupVisible”当我打开一个新的检查没有被有时也被称为。为什么会发生这种情况?我应该怎样做才能在每次打开新的检查员时执行此回调方法。我错过了什么?