How to simply display the Outlook 2010 window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Garth Nugent

    How to simply display the Outlook 2010 window

    I've created a very simple Office Outlook addin (using Visual Studio 2010 C#) that displays a Winform pops up a window when a new message arrives (using NewMailEx), and adds the sender, subject and received time to a listview object on the form. (The addin is a client only addin and will only be running if Outlook has been started). That all works just fine.

    Now all I want to do is create a method that is actived by a click event of a button that is ON MY WinForm that was instantiated from the simply activates/displays/opens/maximizes/whatever... Outlook Inbox window to the front of any other applications. This to me seems like a very easy thing to do but I'm stumped. Below is my

    Code:
        public partial class ThisAddIn
        {
    	public Outlook.Explorer myOutlookExplorer;
    	frmNewMailAlert fm = new frmNewMailAlert();
    		Outlook.ApplicationEvents_11_NewMailExEventHandler newEmailHandler;
    		
    
    		private void ThisAddIn_Startup(object sender, System.EventArgs e){
    			newEmailHandler = new Outlook.ApplicationEvents_11_NewMailExEventHandler(Application_NewMailEx);
    			Globals.ThisAddIn.Application.NewMailEx += new Outlook.ApplicationEvents_11_NewMailExEventHandler(Application_NewMailEx);
    			fm.lvMessages.View = View.Details;
    			fm.lvMessages.Items.Clear();
    	}
        }
Working...