adxOutlookItemEvents

Add-in Express™ Support Service
That's what is more important than anything else

adxOutlookItemEvents
how to work with it in Delphi VCL 
Peter Horak




Posts: 7
Joined: 2015-12-29
I am trying to recognize when an opened email message is a reply to another email, a brand new email, or just an email opened for reading. So far I was only working with Inspectors, where I can specify InspectorMode, thus getting a basic info about read/compose. Now in Explorer it is different.
In a few other posts I found a few ideas for .NET, and it appears that it will be helpful to work with MailItem events. I was trying to do something of that kind in Delphi, and I failed to get anywhere.
Example here: https://www.add-in-express.com/forum/read.php?FID=1&TID=10586
here: https://www.add-in-express.com/creating-addins-blog/2011/12/08/handle-outlook-item-reply-event/
or here: https://www.add-in-express.com/forum/read.php?FID=5&TID=7620&MID=38280#message38280

Is there a Delphi example of how to work with MailItem events? If not, can you paste a sample code that would differentiate between new/reply/view_only kind of mail item?

Thank you!
Posted 11 Jan, 2016 03:42:01 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Peter,

A newly created email has an empty string in its its EntryId. Any saved email contains a non-empty string in the EntryID property. The Sent property is true if the email is received; it is false if the email is composed.

To intercept events of the MailItem object you use TMailItem, see e.g. https://www.add-in-express.com/forum/read.php?FID=1&TID=407.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Jan, 2016 09:36:19 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Peter,

At https://social.msdn.microsoft.com/Forums/office/en-US/92108fcd-0993-48ec-860d-35c419856d39/how-can-i-determine-a-new-replyforward-messages-parent-mailitem-in-an-outlook-2010-cnet-addin?forum=outlookdev, Ken Slovak - a recognized Outlook guru - says:

A reply or forward message should have ConversationIndex and ConversationTopic properties that aren't null or null string. It will also have Saved = false when it opens.


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Jan, 2016 03:56:08 Top