Link to home
Start Free TrialLog in
Avatar of Kenny Hopton
Kenny HoptonFlag for United States of America

asked on

Hook the completion event

I am new to Outlook coding and am really only doing VBA at this point.  I want to have a script that runs whenever a Task item is marked complete.  The idea is to manipulate the item and then set it incomplete again.

I expect to derive a new class such as Item.Task.Regenerating from Task and tweak the forms a bit but I don't know how many places I need to hook to get all possible events that toggle a task to be completed.
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, khopton.

There is no completion event in Outlook.  You can trap events for the task folder and check items as they are saved taking action if the task is marked complete.  VBA does not support object inheritance so you cannot derive a class.  You can write your own class, but you cannot inherit from any existing Outlook objects.
Avatar of Kenny Hopton

ASKER

Thanks for responding.  

- Can you point me to an example of trapping events for the task folder?  I assume that when a user changes the complete icon in the folder view this event fires, right?

- I guess when a user opens an item, changes the completed status and saves it I can get in before the save completes and change the item.

Do these two approaches encompass all the ways a task gets completed?  What I'm really asking here is - can I assume that no task will have it's completed status changed without me knowing if I monitor these two things?

Thanks for your help!
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just what I needed.  Thank you.