How can i connect app.ActiveExplorer()

Apr 22, 2009 at 5:39 PM
Hi,

nice work.
Please could you tell me how can i connect the app.ActiveExplorer()?

With the MS.Interop.Outlook.dll i use the following code code.

{
             Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.ApplicationClass();
             Microsoft.Office.Interop.Outlook.NameSpace NS = app.GetNamespace("MAPI");
             Microsoft.Office.Interop.Outlook.MAPIFolder objFolder = NS.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
             Microsoft.Office.Interop.Outlook.MailItem objMail;
             Microsoft.Office.Interop.Outlook.Items oItems = objFolder.Items;
           
                if (app.ActiveExplorer() != null && app.ActiveInspector() != null)
                {
                    for (int i = 1; i <= app.ActiveExplorer().Selection.Count; i++)
                    {

                       objMail = (Microsoft.Office.Interop.Outlook.MailItem)app.ActiveExplorer().Selection[i];
                      
                        MessageBox.Show("Subject  : " + objMail.Subject.ToString());
                       
                    }
                }
}

thank you very much
Bounty4