I have an outlook addin code for when user right clicks on any email the addin option shows up in the right click menu. This happens for Outlook 2007 and Outlook 2010 but when I install the addin in Outlook 2013 the option does not show up in the right click menu.
here is my code :
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;
}
}
What must I do to make the addin option visible in Outlook 2013 ? Any suggestions ?