我有一個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