Esempio n. 1
0
        private void buttonStartExample_Click(object sender, EventArgs e)
        {
            // start outlook
            Outlook.Application outlookApplication = new Outlook.Application();

            // get inbox
            Outlook._NameSpace outlookNS   = outlookApplication.GetNamespace("MAPI");
            Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);

            // setup gui
            listViewInboxFolder.Items.Clear();
            labelItemsCount.Text = string.Format("You have {0} e-mails.", inboxFolder.Items.Count);

            // we fetch the inbox folder items.
            foreach (COMObject item in inboxFolder.Items)
            {
                // not every item in the inbox is a mail item
                Outlook.MailItem mailItem = item as Outlook.MailItem;
                if (null != mailItem)
                {
                    ListViewItem newItem = listViewInboxFolder.Items.Add(mailItem.SenderName);
                    newItem.SubItems.Add(mailItem.Subject);
                }
            }

            // close outlook and dispose
            outlookApplication.Quit();
            outlookApplication.Dispose();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Outlook.Application application = new Outlook.Application();

            // Get inbox
            Outlook._NameSpace outlookNS = application.GetNamespace("MAPI");
            Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);

            for (int i = 1; i <= 100; i++)
            {
                labelCurrentCount.Text = "Step " + i.ToString();
                Application.DoEvents();
                if (_cancel)
                    break;

                // fetch inbox
                ListInBoxFolder(inboxFolder);
            }

            labelCurrentCount.Text = "Done!";

            // close outlook and dispose
            application.Quit();
            application.Dispose();
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Outlook.Application application = COMObject.CreateByRunningInstance <Outlook.Application>();

            // Get inbox
            Outlook._NameSpace outlookNS   = application.GetNamespace("MAPI");
            Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);

            for (int i = 1; i <= 100; i++)
            {
                labelCurrentCount.Text = "Step " + i.ToString();
                Application.DoEvents();
                if (_cancel)
                {
                    break;
                }

                // fetch inbox
                ListInBoxFolder(inboxFolder);
            }

            labelCurrentCount.Text = "Done!";

            // close outlook and dispose
            if (application.FromProxyService)
            {
                application.Quit();
            }
            application.Dispose();
        }
Esempio n. 4
0
        private void buttonStartExample_Click(object sender, EventArgs e)
        {
            // start outlook
            Outlook.Application outlookApplication = new Outlook.Application();

            // get inbox 
            Outlook._NameSpace outlookNS = outlookApplication.GetNamespace("MAPI");
            Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);

            // setup gui
            listViewInboxFolder.Items.Clear();
            labelItemsCount.Text = string.Format("You have {0} e-mails.", inboxFolder.Items.Count);

            // we fetch the inbox folder items.
            foreach (COMObject item in inboxFolder.Items)
            {
                // not every item in the inbox is a mail item
                Outlook.MailItem mailItem = item as Outlook.MailItem;
                if (null != mailItem)
                {
                    ListViewItem newItem = listViewInboxFolder.Items.Add(mailItem.SenderName);
                    newItem.SubItems.Add(mailItem.Subject);
                }
            }

            // close outlook and dispose
            outlookApplication.Quit();
            outlookApplication.Dispose();
        }
Esempio n. 5
0
        private void buttonStartExample_Click(object sender, EventArgs e)
        {
            // start outlook by trying to access running application first
            Outlook.Application outlookApplication = new Outlook.Application(true);

            // get inbox
            Outlook._NameSpace outlookNS   = outlookApplication.GetNamespace("MAPI");
            Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);

            // setup ui
            listViewInboxFolder.Items.Clear();
            labelItemsCount.Text = string.Format("You have {0} e-mail(s).", inboxFolder.Items.Count);

            // we fetch the inbox folder items by a custom enumerator
            foreach (ICOMObject item in inboxFolder.Items)
            {
                // not every item in the inbox is a mail item
                Outlook.MailItem mailItem = item as Outlook.MailItem;
                if (null != mailItem)
                {
                    ListViewItem newItem = listViewInboxFolder.Items.Add(mailItem.SenderName);
                    newItem.SubItems.Add(mailItem.Subject);
                }
            }

            // close outlook and dispose
            if (!outlookApplication.FromProxyService)
            {
                outlookApplication.Quit();
            }
            outlookApplication.Dispose();
        }
Esempio n. 6
0
        public TestResult DoTest()
        {
            Outlook.Application application = null;
            DateTime            startTime   = DateTime.Now;

            try
            {
                // start outlook
                application = new Outlook.Application(true);
                NetOffice.OutlookSecurity.Suppress.Enabled = true;

                // Get inbox
                Outlook._NameSpace outlookNS   = application.GetNamespace("MAPI");
                Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);

                Outlook._Items items = inboxFolder.Items;
                COMObject      item  = null;
                int            i     = 1;
                do
                {
                    if (null == item)
                    {
                        item = items.GetFirst() as COMObject;
                    }

                    // not every item is a mail item
                    Outlook.MailItem mailItem = item as Outlook.MailItem;
                    if (null != mailItem)
                    {
                        Console.WriteLine(mailItem.SenderName);
                    }

                    if (null != item)
                    {
                        item.Dispose();
                    }

                    item = items.GetNext() as COMObject;
                    i++;
                } while (null != item);

                return(new TestResult(true, DateTime.Now.Subtract(startTime), "", null, string.Format("{0} Inbox Items.", items.Count)));
            }
            catch (Exception exception)
            {
                return(new TestResult(false, DateTime.Now.Subtract(startTime), exception.Message, exception, ""));
            }
            finally
            {
                if (null != application)
                {
                    if (!application.FromProxyService)
                    {
                        application.Quit();
                    }
                    application.Dispose();
                }
            }
        }
        private void Initialize()
        {
            outlookApp = new Outlook.Application();

            outlookNS   = outlookApp.GetNamespace("MAPI");
            inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);

            items = (Outlook.Items)inboxFolder.Items;
            items.ItemAddEvent +=
                new Outlook.Items_ItemAddEventHandler(items_ItemAdd);
        }
Esempio n. 8
0
        public TestResult DoTest()
        {
            Outlook.Application application = null;
            DateTime startTime = DateTime.Now;
            try
            {
                // start outlook
                application = new Outlook.Application();
                NetOffice.OutlookSecurity.Supress.Enabled = true;

                // Get inbox 
                Outlook._NameSpace outlookNS = application.GetNamespace("MAPI");
                Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
              
                Outlook._Items items = inboxFolder.Items;
                COMObject item = null;
                int i = 1;
                do
                {
                    if (null == item)
                        item = items.GetFirst() as COMObject;

                    // not every item is a mail item
                    Outlook.MailItem mailItem = item as Outlook.MailItem;
                    if (null != mailItem)
                        Console.WriteLine(mailItem.SenderName);
                    
                    if(null != item)
                        item.Dispose();

                    item = items.GetNext() as COMObject;
                    i++;
                } while (null != item);
              
                return new TestResult(true, DateTime.Now.Subtract(startTime), "", null, string.Format("{0} Inbox Items.", items.Count));
            }
            catch (Exception exception)
            {
                return new TestResult(false, DateTime.Now.Subtract(startTime), exception.Message, exception, "");
            }
            finally
            {
                if (null != application)
                {
                    application.Quit();
                    application.Dispose();
                }
                NetOffice.OutlookSecurity.Supress.Enabled = false;
            }
        }
Esempio n. 9
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (m_app == null)
            {
                m_app = new Outlook.Application();
                Outlook._NameSpace ns = m_app.GetNamespace("MAPI");

                foreach (Outlook.MAPIFolder folder in ns.Folders)
                {
                    txtResults.AppendText(string.Format("{0} - {1}\r\n", folder.Name, folder.DefaultItemType));
                    TraverseFolders(folder);
                }

                Outlook.MAPIFolder selectedFolder = ns.GetFolderFromID("00000000C5B7DEF515463948B280312D7005404A02870000");

                foreach (object oItem in selectedFolder.Items)
                {
                    if (oItem is Outlook.ContactItem)
                    {
                        Outlook.ContactItem item = (Outlook.ContactItem)oItem;

                        txtResults.AppendText(string.Format("{0}/{1}\r\n", item.FirstName, item.LastName));

                        if (string.Equals("LastName", item.LastName))
                        {
                            propertyGrid1.SelectedObject = item;

                            var props = TypeDescriptor.GetProperties(item);
                            foreach (PropertyDescriptor prop in props)
                            {
                                try
                                {
                                    txtResults.AppendText(string.Format("{0} : {1}\r\n", prop.DisplayName, prop.GetValue(item)));
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.Message);
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 10
0
 public OutlookToolkitApi()
 {
     app = new Outlook.Application();
     ns = app.GetNamespace("MAPI");
 }
Esempio n. 11
0
        public TestResult DoTest()
        {
            Outlook.Application application = null;
            DateTime            startTime   = DateTime.Now;

            try
            {
                Bitmap iconBitmap = new Bitmap(System.Reflection.Assembly.GetAssembly(this.GetType()).GetManifestResourceStream("OutlookTestsCSharp.Test07.bmp"));

                // start outlook
                application = new Outlook.Application();
                NetOffice.OutlookSecurity.Suppress.Enabled = true;

                Office.CommandBar       commandBar;
                Office.CommandBarButton commandBarBtn;

                Outlook._NameSpace outlookNS   = application.GetNamespace("MAPI");
                Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
                inboxFolder.Display();

                // add a commandbar popup
                Office.CommandBarPopup commandBarPopup = (Office.CommandBarPopup)application.ActiveExplorer().CommandBars["Menu Bar"].Controls.Add(MsoControlType.msoControlPopup, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
                commandBarPopup.Caption = "commandBarPopup";

                #region CommandBarButton

                // add a button to the popup
                commandBarBtn         = (Office.CommandBarButton)commandBarPopup.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
                commandBarBtn.Style   = MsoButtonStyle.msoButtonIconAndCaption;
                commandBarBtn.Caption = "commandBarButton";
                Clipboard.SetDataObject(iconBitmap);
                commandBarBtn.PasteFace();
                commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

                #endregion

                #region Create a new toolbar

                // add a new toolbar
                commandBar         = application.ActiveExplorer().CommandBars.Add("MyCommandBar", MsoBarPosition.msoBarTop, false, true);
                commandBar.Visible = true;

                // add a button to the toolbar
                commandBarBtn             = (Office.CommandBarButton)commandBar.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
                commandBarBtn.Style       = MsoButtonStyle.msoButtonIconAndCaption;
                commandBarBtn.Caption     = "commandBarButton";
                commandBarBtn.FaceId      = 3;
                commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

                // add a dropdown box to the toolbar
                commandBarPopup         = (Office.CommandBarPopup)commandBar.Controls.Add(MsoControlType.msoControlPopup, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
                commandBarPopup.Caption = "commandBarPopup";

                // add a button to the popup, we use an own icon for the button
                commandBarBtn         = (Office.CommandBarButton)commandBarPopup.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
                commandBarBtn.Style   = MsoButtonStyle.msoButtonIconAndCaption;
                commandBarBtn.Caption = "commandBarButton";
                Clipboard.SetDataObject(iconBitmap);
                commandBarBtn.PasteFace();
                commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

                #endregion

                return(new TestResult(true, DateTime.Now.Subtract(startTime), "", null, ""));
            }
            catch (Exception exception)
            {
                return(new TestResult(false, DateTime.Now.Subtract(startTime), exception.Message, exception, ""));
            }
            finally
            {
                if (null != application)
                {
                    application.Quit();
                    application.Dispose();
                }
            }
        }
Esempio n. 12
0
        private void buttonStartExample_Click(object sender, EventArgs e)
        {
            // start outlook
            _outlookApplication = new Outlook.Application();

            Office.CommandBar       commandBar    = null;
            Office.CommandBarButton commandBarBtn = null;

            Outlook._NameSpace outlookNS   = _outlookApplication.GetNamespace("MAPI");
            Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
            inboxFolder.Display();

            // add a commandbar popup
            Office.CommandBarPopup commandBarPopup = (Office.CommandBarPopup)_outlookApplication.ActiveExplorer().CommandBars["Menu Bar"].Controls.Add(MsoControlType.msoControlPopup, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
            commandBarPopup.Caption = "commandBarPopup";

            #region few words, how to access the picture

            /*
             * you can see we use an own icon via .PasteFace()
             * is not possible from outside process boundaries to use the PictureProperty directly
             * the reason for is IPictureDisp: http://support.microsoft.com/kb/286460/de
             * its not important is early or late binding or managed or unmanaged, the behaviour is always the same
             * For example, a COMAddin running as InProcServer and can access the Picture Property
             */
            #endregion

            #region CommandBarButton

            // add a button to the popup
            commandBarBtn         = (Office.CommandBarButton)commandBarPopup.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
            commandBarBtn.Style   = MsoButtonStyle.msoButtonIconAndCaption;
            commandBarBtn.Caption = "commandBarButton";
            Clipboard.SetDataObject(_hostApplication.DisplayIcon.ToBitmap());
            commandBarBtn.PasteFace();
            commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

            #endregion

            #region Create a new toolbar

            // add a new toolbar
            commandBar         = _outlookApplication.ActiveExplorer().CommandBars.Add("MyCommandBar", MsoBarPosition.msoBarTop, false, true);
            commandBar.Visible = true;

            // add a button to the toolbar
            commandBarBtn             = (Office.CommandBarButton)commandBar.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
            commandBarBtn.Style       = MsoButtonStyle.msoButtonIconAndCaption;
            commandBarBtn.Caption     = "commandBarButton";
            commandBarBtn.FaceId      = 3;
            commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

            // add a dropdown box to the toolbar
            commandBarPopup         = (Office.CommandBarPopup)commandBar.Controls.Add(MsoControlType.msoControlPopup, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
            commandBarPopup.Caption = "commandBarPopup";

            // add a button to the popup, we use an own icon for the button
            commandBarBtn         = (Office.CommandBarButton)commandBarPopup.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
            commandBarBtn.Style   = MsoButtonStyle.msoButtonIconAndCaption;
            commandBarBtn.Caption = "commandBarButton";
            Clipboard.SetDataObject(_hostApplication.DisplayIcon.ToBitmap());
            commandBarBtn.PasteFace();
            commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

            #endregion

            // set buttons
            buttonStartExample.Enabled = false;
            buttonQuitExample.Enabled  = true;
        }
Esempio n. 13
0
        private void buttonStartExample_Click(object sender, EventArgs e)
        {
            // start outlook
            _outlookApplication = new Outlook.Application();

            Office.CommandBar commandBar = null;
            Office.CommandBarButton commandBarBtn = null;

            Outlook._NameSpace outlookNS = _outlookApplication.GetNamespace("MAPI");
            Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
            inboxFolder.Display();

            // add a commandbar popup
            Office.CommandBarPopup commandBarPopup = (Office.CommandBarPopup)_outlookApplication.ActiveExplorer().CommandBars["Menu Bar"].Controls.Add(MsoControlType.msoControlPopup, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
            commandBarPopup.Caption = "commandBarPopup";

            #region few words, how to access the picture
            /*
             you can see we use an own icon via .PasteFace()
             is not possible from outside process boundaries to use the PictureProperty directly
             the reason for is IPictureDisp: http://support.microsoft.com/kb/286460/de
             its not important is early or late binding or managed or unmanaged, the behaviour is always the same
             For example, a COMAddin running as InProcServer and can access the Picture Property
            */
            #endregion

            #region CommandBarButton

            // add a button to the popup
            commandBarBtn = (Office.CommandBarButton)commandBarPopup.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
            commandBarBtn.Style = MsoButtonStyle.msoButtonIconAndCaption;
            commandBarBtn.Caption = "commandBarButton";
            Clipboard.SetDataObject(HostApplication.DisplayIcon.ToBitmap());
            commandBarBtn.PasteFace();
            commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

            #endregion

            #region Create a new toolbar

            // add a new toolbar
            commandBar = _outlookApplication.ActiveExplorer().CommandBars.Add("MyCommandBar", MsoBarPosition.msoBarTop, false, true);
            commandBar.Visible = true;

            // add a button to the toolbar
            commandBarBtn = (Office.CommandBarButton)commandBar.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
            commandBarBtn.Style = MsoButtonStyle.msoButtonIconAndCaption;
            commandBarBtn.Caption = "commandBarButton";
            commandBarBtn.FaceId = 3;
            commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

            // add a dropdown box to the toolbar
            commandBarPopup = (Office.CommandBarPopup)commandBar.Controls.Add(MsoControlType.msoControlPopup, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
            commandBarPopup.Caption = "commandBarPopup";

            // add a button to the popup, we use an own icon for the button
            commandBarBtn = (Office.CommandBarButton)commandBarPopup.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
            commandBarBtn.Style = MsoButtonStyle.msoButtonIconAndCaption;
            commandBarBtn.Caption = "commandBarButton";
            Clipboard.SetDataObject(HostApplication.DisplayIcon.ToBitmap());
            commandBarBtn.PasteFace();
            commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

            #endregion

            // set buttons
            buttonStartExample.Enabled = false;
            buttonQuitExample.Enabled = true;
        }
Esempio n. 14
0
        public TestResult DoTest()
        {
            Outlook.Application application = null;
            DateTime startTime = DateTime.Now;
            try
            {
                Bitmap iconBitmap = new Bitmap(System.Reflection.Assembly.GetAssembly(this.GetType()).GetManifestResourceStream("OutlookTestsCSharp.Test07.bmp"));

                // start outlook
                application = new Outlook.Application();
                NetOffice.OutlookSecurity.Supress.Enabled = true;

                Office.CommandBar commandBar;
                Office.CommandBarButton commandBarBtn;

                Outlook._NameSpace outlookNS = application.GetNamespace("MAPI");
                Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
                inboxFolder.Display();

                // add a commandbar popup
                Office.CommandBarPopup commandBarPopup = (Office.CommandBarPopup)application.ActiveExplorer().CommandBars["Menu Bar"].Controls.Add(MsoControlType.msoControlPopup, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
                commandBarPopup.Caption = "commandBarPopup";
  
                #region CommandBarButton

                // add a button to the popup
                commandBarBtn = (Office.CommandBarButton)commandBarPopup.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
                commandBarBtn.Style = MsoButtonStyle.msoButtonIconAndCaption;
                commandBarBtn.Caption = "commandBarButton";
                Clipboard.SetDataObject(iconBitmap);
                commandBarBtn.PasteFace();
                commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

                #endregion

                #region Create a new toolbar

                // add a new toolbar
                commandBar = application.ActiveExplorer().CommandBars.Add("MyCommandBar", MsoBarPosition.msoBarTop, false, true);
                commandBar.Visible = true;

                // add a button to the toolbar
                commandBarBtn = (Office.CommandBarButton)commandBar.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
                commandBarBtn.Style = MsoButtonStyle.msoButtonIconAndCaption;
                commandBarBtn.Caption = "commandBarButton";
                commandBarBtn.FaceId = 3;
                commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

                // add a dropdown box to the toolbar
                commandBarPopup = (Office.CommandBarPopup)commandBar.Controls.Add(MsoControlType.msoControlPopup, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
                commandBarPopup.Caption = "commandBarPopup";

                // add a button to the popup, we use an own icon for the button
                commandBarBtn = (Office.CommandBarButton)commandBarPopup.Controls.Add(MsoControlType.msoControlButton, System.Type.Missing, System.Type.Missing, System.Type.Missing, true);
                commandBarBtn.Style = MsoButtonStyle.msoButtonIconAndCaption;
                commandBarBtn.Caption = "commandBarButton";
                Clipboard.SetDataObject(iconBitmap);
                commandBarBtn.PasteFace();
                commandBarBtn.ClickEvent += new Office.CommandBarButton_ClickEventHandler(commandBarBtn_Click);

                #endregion
              
                return new TestResult(true, DateTime.Now.Subtract(startTime), "", null, "");
            }
            catch (Exception exception)
            {
                return new TestResult(false, DateTime.Now.Subtract(startTime), exception.Message, exception, "");
            }
            finally
            {
                if (null != application)
                {
                    application.Quit();
                    application.Dispose();
                }
                NetOffice.OutlookSecurity.Supress.Enabled = false;
            }
        }