none
Outlook VSTO App - C# - BeforeReminderShow event not working RRS feed

  • Question

  • Hi,

    I am writing an app which triggers a USB LED light when meeting reminders pop in outlook.  I was using the Reminder event to do this but if I have a lot of reminders that pop at the same time then it really slows down as it fires that event for each reminder.

    I found the BeforeReminderShow event and it looks like this would be a better event to use.  Problem is that I can't get it to work when I am running my add-in in debug mode. 

    I did notice that it worked when I rebooted my computer and loaded outlook (without VS running) but I can't seem to get it to work again.

    here is the code I use.  

    using Outlook = Microsoft.Office.Interop.Outlook;
    
    private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
      this.Application.NewMailEx += new Outlook.ApplicationEvents_11_NewMailExEventHandler(ThisAddIn_NewMail);
      this.Application.Reminder += new Outlook.ApplicationEvents_11_ReminderEventHandler(ThisAddIn_Reminder);
      this.Application.Reminders.BeforeReminderShow += new Outlook.ReminderCollectionEvents_BeforeReminderShowEventHandler(ThisAddin_BeforeReminderShow);
    }
    
    void ThisAddin_BeforeReminderShow(ref bool Cancel)
    {
      MessageBox.Show("Before Reminder Show triggered");
      triggerReminderAlert();
    }
    

    The other two events for Reminder and NewMailEx work great in debug mode.

    Any idea why this won't fire for me?

    Also open to any other ideas.  Basically I want to be able to trigger 1 event when the reminders window fires regardless of the # of visible reminders that are firing at the same time.

    Thanks in advance.

    JB

    Thursday, August 24, 2017 5:53 PM

All replies

  • Hi JBSAP,

    I try to test the code on my side.

    on my side it is working correctly , when I try to run the Addin from Visual Studio.

    I suggest you to remove the event and again try to add to your project and try to make a test.

    if then also it not work then I suggest you to create a new project for testing purpose and try to add only this event and make a test.

    so that we can know that the issue is with your project or it can be reproduce by other project too.

    if new project working correctly then try to clean solution of old project and rebuild the project again.

    it is possible that something get corrupted in that.

    let us know about your testing result , so that we can try to provide you further suggestions if needed.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 25, 2017 2:11 AM
    Moderator
  • Thanks Deepak,

    What version of outlook were you testing with?

    I'll try a sample add-in to see if that works.  

    I've tested cleaning the project with no luck.  I have also tried removing and re-adding the event but that doesn't seem to work either.

    I'll let you know how it goes.  Good to know the code/event works.  I has to be environmental.

    Thanks

    Jb

    Friday, August 25, 2017 3:18 PM
  • Tested with a sample app and it works but is inconsistent.  After a while it stopped showing my Reminders window all together and it wouldn't come back until I restarted my computer.

    It is definitely inconsistent from what I have seen.

    also, when I run my add-in in release mode it works the first time the reminders window pops and then it stops firing after that.

    I suspect I may have another plugin that is interfering.  Maybe one of the other add-ins uses the same event and there is some sort of race condition happening.

    I'll do some more testing.  At least I know the event is working some of the time so that code seems to be good.

    Friday, August 25, 2017 9:25 PM
  • Hi JBSAP,

    you had mentioned that,"I suspect I may have another plugin that is interfering.  Maybe one of the other add-ins uses the same event and there is some sort of race condition happening."

    I suggest you to temporary disable the other addins and try to make a test.

    so if any other addin is interfering then we can know about that.

    I also suggest you to update your Outlook application with latest updates, if any available.

    let us know about your testing results. so that we can try to provide you further suggestions if needed.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, August 28, 2017 3:17 AM
    Moderator