我有一个outlook插件代码,当用户右键单击addin选项在右键菜单中显示的任何电子邮件时。这发生在Outlook 2007和Outlook 2010中,但是当我在Outlook 2013中安装插件时,该选项不会显示在右键单击菜单中。Addin Code在Outlook 2007和2010中工作,但不在Outlook 2013中
这里是我的代码:
Application.ItemContextMenuDisplay += ApplicationItemContextMenuDisplay;
void ApplicationItemContextMenuDisplay(Office.CommandBar commandBar, Selection selection)
{
var cb = commandBar.Controls.Add(Office.MsoControlType.msoControlButton,missing, missing, missing, true) as Office.CommandBarButton;
if (cb == null) return;
cb.Visible = true;
cb.FaceId = 1675;
cb.Style = Office.MsoButtonStyle.msoButtonIconAndCaption;
cb.Click += new Office._CommandBarButtonEvents_ClickEventHandler(_oAddEmail_Click);
ConvergeCRMSetting settings = StateManager.current.CRMSettings;
if (selection.Count == 1 && selection[1] is Outlook.MailItem)
{
var item = (MailItem)selection[1];
string subject = item.Subject;
cb.Caption = "Add Email To ConvergeHub";
cb.Enabled = true;
}
else
{
cb.Enabled = false;
}
bool bflag = false;
if (settings.Verified == true && settings.Active == true)
{
bflag = true;
}
switch (Convert.ToInt16(settings.Sd))
{
case 0:
cb.Enabled = false;
break;
case 1:
cb.Enabled = bflag;
break;
case 2:
cb.Enabled = bflag;
break;
case 3:
//rbManual.Checked = true;
break;
default:
break;
}
}
我必须做什么,使插件选项,Outlook 2013中可见?有什么建议么 ?
是否将Reference .dll更新为最新版本?我们在工作中使用Excel Interop并且从Office 2010升级到2013年造成了一些严重问题。 –
您的意思是Reference.dll或Outlook互操作参考? 在Outlook互操作性参考的情况下,我没有升级它,因为在那种情况下,我必须升级每个新版本进入市场。 – Mainak