I am writing an outlook addin using c#.
The addin will work on the ItemSend event of inspector. In the event handler code, I will cancel the operation, then start a thread to process the mail, then close the mail. In the thread code, I call the send command on the mailitem.
My addin code works for email created from outlook explorer.
However when user tries to send files from window explorer by selecting "send to" then "mail recipient" command, a new email is created with files added as attachment. When user clicks send button on the mail, my addin code will fail to send the mail due to exception "System.Runtime.InteropServices.COMException (0x80004005): This item is no longer valid because it has been closed."
My question: How can I tell that this email is created by window file explorer, not outlook explorer in my addin code?
Thanks!
The addin will work on the ItemSend event of inspector. In the event handler code, I will cancel the operation, then start a thread to process the mail, then close the mail. In the thread code, I call the send command on the mailitem.
My addin code works for email created from outlook explorer.
However when user tries to send files from window explorer by selecting "send to" then "mail recipient" command, a new email is created with files added as attachment. When user clicks send button on the mail, my addin code will fail to send the mail due to exception "System.Runtime.InteropServices.COMException (0x80004005): This item is no longer valid because it has been closed."
My question: How can I tell that this email is created by window file explorer, not outlook explorer in my addin code?
Thanks!