Why are Sticky Notes causing a problem with my VB Code in Microsoft Outlook?
Posted on 2014-10-29
I have a chunk of VB code that I use in Microsoft Outlook that is solely to recognize when a new Appointment Item is opened and, if so, the code prompts me to ask if I want to create an Agenda for the meeting. The code should only activate when I open a new Appointment Item from my calendar.
Currently, it does not execute when: (1) a new/existing E-mail item is opened, (2) a new/existing Task is opened, (3) a new/existing Contact is opened, (4) an existing Calendar item is opened.
However, it does execute when a new Calendar item is opened.
Up to this point, everything is great and it is doing exactly what I want it to!
But, here is the rub... for some reason it tries to execute whenever a new or existing Sticky Note is opened. When I open a Sticky Note, it also hits me with a Run Time error 91:Object Variable or With Block variable not set.
Here is the start of my code, with a remark on the line that is highlighted when I get the error:
Can someone give me any suggestions on how to keep this code from executing when a new or existing Sticky Note is opened? Thanks!