Quantcast
Channel: Office 2013 and Office 365 ProPlus - Planning, Deployment, and Compatibility forum
Viewing all articles
Browse latest Browse all 3748

Outlook Add-In stopped responding

$
0
0

HI everyone,

 I have made an Outlook 2013 add-in which listen old all incoming emails. 

 This is working fine for a couple of hours, but then it stoppes being notified about new emails, I have attached the code I use for subscribe to the event and the event it self. 

        private Outlook.MAPIFolder inbox = null;

       private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            //Loading the inbox
            inbox = Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);

            inbox.Items.ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(Items_ItemAdd);
}

        void Items_ItemAdd(object Item)
        {
            if(settings.IsAddInEnabled)
            {
                ItemInspector(Item);
            }
            ribbon.lblCounter.Label = "Antal Mails siden start: " + ++counter;

        }

 private void ItemInspector(object Item)
        {
            if (Item is Outlook.MailItem)
            {
                var mail = Item as Outlook.MailItem;

                if (mail.Attachments.Count > 0)
                {
                            mail.UnRead = false;
}
}
}


Viewing all articles
Browse latest Browse all 3748

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>