Ejemplo n.º 1
0
        private void CurrentExplorer_Event()
        {
            Outlook.MAPIFolder selectedFolder =
                olApp.ActiveExplorer().CurrentFolder;


            Outlook.Selection oSel = olExplorer.Selection;

            /* if (oSel.Count != 1)
             * {
             *   MessageBox.Show("Please select only one message for PKCS#7 structure inspection!");
             *   return;
             * }
             * */
            System.Collections.IEnumerator i = oSel.GetEnumerator();
            i.MoveNext();

            Object selObject = (Outlook.MailItem)i.Current;

            if (selObject is Outlook.MailItem)
            {
                Outlook.MailItem mailItem =
                    (selObject as Outlook.MailItem);
                try
                {
                    bool doIt = false;



                    SafeMailItem smi = new SafeMailItemClass();
                    smi.Item = mailItem;

                    mailID = mailItem.EntryID;

                    /*Outlook.NameSpace ns = olApp.GetNamespace("MAPI");
                     *
                     * Outlook.MAPIFolder f = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
                     * Outlook.Folders folders = f.Folders;
                     * foreach (Outlook.Folder fol in folders) {
                     *  if (fol.Name == "TEST") {
                     *      //
                     *      break;
                     *  }
                     *
                     * }
                     *
                     */
                    // @"\\Mailbox - Dauberschmidt, Markus\Inbox\TEST"
                }
                catch (Exception ie)
                {
                    MessageBox.Show("Exception: " + ie.Message);
                }
            }
        }
Ejemplo n.º 2
0
        private void ButtonClick(Office.CommandBarButton ButtonContrl, ref bool CancelOption)
        {
            // Message box displayed on button click


            P7MViewer.frmMain  m = new P7MViewer.frmMain();
            Outlook.MAPIFolder selectedFolder =
                olApp.ActiveExplorer().CurrentFolder;


            Outlook.Selection oSel = olExplorer.Selection;
            if (oSel.Count != 1)
            {
                MessageBox.Show("Please select only one message for PKCS#7 structure inspection!");
                return;
            }

            System.Collections.IEnumerator i = oSel.GetEnumerator();
            i.MoveNext();

            Object selObject = (Outlook.MailItem)i.Current;

            if (selObject is Outlook.MailItem)
            {
                Outlook.MailItem mailItem =
                    (selObject as Outlook.MailItem);
                try
                {
                    SafeMailItem smi = new SafeMailItemClass();
                    smi.Item = mailItem;



                    m.setOutlookMessage(mailItem);
                    m.Show();
                    m.readMail();
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message);
                }
            }
        }