Board index » delphi » Outlook COM-Addin: Slim solution to handle Item events?
Oliver Giesen
![]() Delphi Developer |
Outlook COM-Addin: Slim solution to handle Item events?2006-01-02 10:27:17 PM delphi152 Hi all! Most of the examples of COM-Addins for Outlook I found so far were written in VB. I have no practical experience in VB(Visual Basic) myself at all but from those examples it seems that it is possible to simply write a function named for instance Item_Reply and boom that function will get called whenever an item is replied to. The only aproach of handling the same thing in Delphi I found so far was to hook into the Explorer.SelectionChange event, then loop through the items in Explorer.Selection, create a TOleServer-descended wrapper for each of them and finally assign the appropriate event handlers. Obviously before filling up that internal list of TOleServer's one also has to make sure all previous wrappers are released again. Compared to the VB(Visual Basic) approach this seems like utter overkill and from my tests it seems this technique is indeed associated with a noticeable performance hit for large selections. Another downside is that this way you do not even get at items in the result list of Advanced Find or New Mail notification windows. So this couldn't really be what's going on behind the scenes in the VB(Visual Basic) addins, could it? Put differently: Is there some way in Delphi to globally register event handlers for items instead of having to do it explicitly on each and every individual item in sight? So far I have not been able to find anything to that effect in the OOM... am I just too dumb? Cheers, -- Oliver |