.net - VSTO Outlook: Creating a dynamic custom context menu for a mail item determined by subject line -


By inspection of the contents of this item is possible to add a mail item different items in the custom context menu?
The subject line contains "Important", for example, only add items.

seems to work.

  void Application_ItemContextMenuDisplay (Office.CommandBar CommandBar, Outlook.Selection selection) {foreach (choose Outlook.MailItem m) {if (m.Subject.Contains ( "important")) {DeliveryFailureButton ( Commandbar, selection); break; }}} Void DeliveryFailureButton (Office.CommandBar CommandBar, Outlook.Selection selection) {Office.CommandBarButton btn = CommandBar.Controls.Add (Office.MsoControlType.msoControlButton, missing, missing, missing, really) as Office.CommandBarButton; BTN Caption = "move to important messages"; Btnkklik + = (Ofiskkmmandbarbutton stalls, ref bool Kansldefaolt) = & gt; {String msg = "CRM Records \ r \ n"; The foreach (Outlook.MailItem election item) {(Outlook.MailItem item) if {var mitem = Outlook.MailItem as before; Msg + = "\ r \ n" + Hatotoimportent (mitum); }} MessageBox.Show (msg); }; }  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -