We have an Outlook com plugin that we had written for us on RAC a couple of years ago in VB6.
When an eMail is sent in Outlook, the plugin runs and checks a couple of properties of the eMail and then depending on these properties either updates the status of the eMail, or calls a dll (part of our application) that? saves a copy of the eMail as a .msg file and updates our database.
The plugin operates by loading the incoming mail item into a collection and then reading it from the collection and processing it as above.
This works fine 99% of the time, but occasionally, the queue collection doesnt seem to clear before the next eMail gets processed and we get the message 'Key not unique in this collection' after which the plugin and/or the dll will not work again until Outlook is terminated and restarted.
I have tried putting in loops and error tests to try and delay the message being loaded into the queue collection until it is empty but it doesnt seem to make any difference, but it may be I dont really understand the problem.
Can you provide a fix or suggest another way of doing this - the source code for the plugin is available should you need it.