Question

I'm developing an outlook 2010 add-in in c#/.net. I have some items that I need to export to a specific location from inbox let's say. But in the same time when the user replies to this mail item (that was previous exported - I change the MessageClass when export it), I need to export the reply too when the user sends the reply. I catch the new inspector event and set the send event to my item, but I cannot figure out how can I be sure that the user presses Reply and not Forward for example?! I cannot find any property in the inspector that can tell me for sure that the Reply button was pressed.

Do you have any ideas?!

Thanks

Was it helpful?

Solution

There are a couple of ways to achieve this. Assuming you already checked if it was a new message or sent message (via MailItem.Sent), you can just check whether there are any recipients specified (via MailItem.To or MailItem.Recipients) to know whether the message is a Forward or Reply.

bool isReply = !string.IsNullOrEmpty(MailItem.To) || MailItem.Recipients.Count > 0 ;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top