Outlook Add-In stopped responding

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;
}
}
}

May 7th, 2015 11:48am

Hi Lars,

What do you mean the Add-in stop responding? Does it throw the exception or the add-in be disabled?

You may enable add-in user interface errors to check whether it has the errors.

# Show Add-in User Interface Errors

https://msdn.microsoft.com/en-us/library/bb608619.aspx

Regards

Starain

Free Windows Admin Tool Kit Click here and download it now
May 8th, 2015 5:54am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics