Пример #1
0
        public FormArchiveRename(ThisAddIn addin)
        {
            Activate(addin);

            if (addin.GetApplication().ActiveExplorer().Selection.Count > 0)
            {
                Microsoft.Office.Interop.Outlook.Selection mySelection = addin.GetApplication().ActiveExplorer().Selection;


                foreach (Object obj in mySelection)
                {
                    if (obj is Microsoft.Office.Interop.Outlook.MailItem)
                    {
                        mailitem = (Microsoft.Office.Interop.Outlook.MailItem)obj;
                    }
                }
            }

            InitializeComponent();
            UpdateLabelsWithLang(culture);
            AddLastPathsToCombo();
        }
Пример #2
0
        public void FileMessage_OnClick(Microsoft.Office.Core.IRibbonControl control)
        {
            var app      = new Microsoft.Office.Interop.Outlook.Application();
            var explorer = app.ActiveExplorer();

            Microsoft.Office.Interop.Outlook.Selection selections = explorer.Selection;
            Microsoft.Office.Interop.Outlook.Folder    inbox      = app.Session.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox) as Microsoft.Office.Interop.Outlook.Folder;

            foreach (var selection in selections)
            {
                var personName = string.Empty;

                if (selection is Microsoft.Office.Interop.Outlook.MailItem)
                {
                    personName         = ((Microsoft.Office.Interop.Outlook.MailItem)selection).SenderName;
                    _destinationFolder = GetMatchingFolder(inbox, personName);

                    MoveMailItem((Microsoft.Office.Interop.Outlook.MailItem)selection, personName);
                }
                else if (selection is Microsoft.Office.Interop.Outlook.MeetingItem)
                {
                    personName         = ((Microsoft.Office.Interop.Outlook.MeetingItem)selection).SenderName;
                    _destinationFolder = GetMatchingFolder(inbox, personName);

                    MoveMeetingItem((Microsoft.Office.Interop.Outlook.MeetingItem)selection, personName);
                }
                else
                {
                    MessageBox.Show("Unknown message type, can't move it.");
                    break;
                }

                _destinationFolder = null;
            }

            _destinationFolder = null;
        }
Пример #3
0
 void _OutlookApplication_ItemContextMenuDisplay(Microsoft.Office.Core.CommandBar CommandBar, Microsoft.Office.Interop.Outlook.Selection Selection)
 {
     DisplayInWatchWindow(ItemContextMenuDisplay++, System.Reflection.MethodInfo.GetCurrentMethod().Name);
 }