Ho do I hook to Task completed event?

  • Thread starter Thread starter Slava Barouline
  • Start date Start date
S

Slava Barouline

I would like to do something in my Add-in when user marks an Outlook Task as
completed
How can I hook to this event?

Thanks
Slava
 
There is no specific event for marking a task as complete. You would have to
handle the ItemChange event for the Items collection of the folder you are
interested in and see if the item is now marked complete.
 
Thanks Ken

I was thinking more about Item.OnSave
Do you think it will be the same or Items.ItemChange is better?

Also I have found two properties:
8040 - Complete
804E - Status

Which one do I use (or maybe both)?
 
There is no OnSave event for items in the Outlook object model. There's a
..Save event for items but you have to then have each possible item that
could be saved instantiated to handle events. That would be relatively easy
if the user opens each item before marking it complete and saving it but
that doesn't have to be. The user could mark it complete from a folder view
(Explorer) and then you'd have to trap each change in Explorer.Selection and
instantiate an event handler for each selected item and change each time
selection changed.

What API or object model are you using? Properties in Outlook would be
Complete and Status, the property tags would be irrelevant. You could read
the Complete Boolean property or check Status for olTaskComplete (2).

Where did you get those values for Complete and Status?

In MAPI terms Complete would be
GetIDsFromNames("{00062003-0000-0000-C000-000000000046}", 0x811C) OR
PT_BOOLEAN and Status would be
GetIDsFromNames("{00062003-0000-0000-C000-000000000046}", 0x8101) OR
PT_LONG.
 
Ken

I am using a mixture of ExMAPI and OOM in my Add-in

I already have DoSelection anyway, but for simplicity sake I will try
ItemChange first

You are right - I looked at tag sym instead of a value in Outlook Spy
I will try boolean Complete then
 
Also I have found two properties:
8040 - Complete
804E - Status

Complete and Status are named properties and the tag sym values would vary
from mail store to mail store. For example on my Exchange mailbox the tag
sym for Complete is 0x8044 and for Status it's 0x807B. You cannot depend on
a named property having the exact same value on different mail stores, you
have to use some method like GetIDsFromNames to get the actual property tag
for that specific mail store.
 
Back
Top