[英]Addin Code Working in outlook 2007 and 2010 but not in outlook 2013
當用戶右鍵單擊任何電子郵件時,我有一個Outlook加載項代碼,該加載項選項會顯示在右鍵單擊菜單中。 對於Outlook 2007和Outlook 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中可見? 有什么建議么 ?
不建議使用命令欄-您必須使用IRibbonExtensibility自定義Outlook 2013+的上下文菜單:
您可以在Outlook 2007中使用一種舊方法(CommandBars)。但是從Outlook 2010開始,Fluent UI用於自定義Outlook中的上下文菜單。 您可以在以下文章中閱讀有關此內容的更多信息:
以下文章描述了Fluent UI(又稱Ribbon UI):
功能區設計器不提供任何上下文菜單。 您將需要使用功能區XML標記來自定義上下文菜單。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.