Outlook Item Events

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

Outlook Item Events
How to trap Item events such as ItemClose 
Andrew Lockwood




Posts: 50
Joined: 2014-12-29
I have been playing with the TadxOutlookAppEvents component and note that it provides functionality to trap ItemLoad and ItemSend events. However, it does not appear to provide access to other trappable Item events such as ItemClose, for example.

Am I missing something obvious here, or do I need to write my own routines to trap these other events? If so, is there any sample code to show me how it should be done correctly?

I have looked at the sample code for Outlook Events, and I have previously had a go at this before buying Add-In Express, so I have some idea about how to do it, but I am puzzling over why the TadxOutlookAppEvents component provides access to some events, but not others.
Posted 13 Jan, 2015 19:24:50 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Hello Andrew,

Outlook provides events through several objects, not only through the Application object. You access item-level events using TMailItem, TTaskItem, etc.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 14 Jan, 2015 06:00:08 Top
Andrew Lockwood




Posts: 50
Joined: 2014-12-29
Thanks for the reply. But am I missing something. I can see that TMailItem is defined in Outlook2000, but what about TTaskItem, for example? Is that defined anywhere?
Posted 21 Jan, 2015 03:07:14 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
TTaskItem is declared in Outlook2000, too.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 21 Jan, 2015 03:21:29 Top
Andrew Lockwood




Posts: 50
Joined: 2014-12-29
Well, it is not in the version of the file that I have - the one that shipped with Delphi XE2! That is what prompted the question in the first place.

Andrew
Posted 21 Jan, 2015 08:40:52 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Hmmm, it looks like a bug in Delphi Xe2. I'll create such a class soon and send it to you by email.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 21 Jan, 2015 09:58:00 Top
Andrew Lockwood




Posts: 50
Joined: 2014-12-29
Thanks for the offer.

I found another version of the Office2000 library files on another computer and tried using them instead, but that did not work, because I now get an error saying that Office2000.Assistant was compiled with a different version of Publisher2003.

As I do not have the source files for Publisher2003, I am now stuck!

So some further assistance would be helpful.

Thanks.


Andrew
Posted 22 Jan, 2015 02:27:48 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Hello Andrew,

You don't need to use Office2000 library files. Instead, you need to add the TTaskItem class to your project.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 22 Jan, 2015 04:25:17 Top
Andrew Lockwood




Posts: 50
Joined: 2014-12-29
Sorry, but you are confusing me. The class is not defined in my current Outlook2000 library, so if I try and reference TTaskItem, I get an error because it does not exist.

So surely, I need to somehow incorporate the "correct" Outlook2000 file into my project so that the class is then defined and accessible?


Andrew
Posted 22 Jan, 2015 07:58:00 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Andrew,

Have you received an email from me? I sent it yesterday to the email address registered with the forum.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 22 Jan, 2015 08:23:01 Top