Forum Admin
Senior Member
change one of the if lines:
If TypeOf Item Is Outlook.TaskItem AND instr(1, item.categories, "Complete") = 0 Then
or
If Task.Status = olTaskComplete AND instr(1, task.categories, "Complete") = 0 Then
the first one kicks it out quicker if the task has the category. I'm not sure it really matters - so use the one that is less confusing or will be easier to understand weeks down the road when you look at it and think "WTF is this doing."
also, i'm pretty sure you need to save the task to set the category when you use code.
You have
Item.Categories = Item.Categories & ";Complete"
but not item.save
Michael: I don't know if you know the answer, but is there any benefit to using
Set Task = Item
instead of referring to the original task as item in this macro?
If TypeOf Item Is Outlook.TaskItem AND instr(1, item.categories, "Complete") = 0 Then
or
If Task.Status = olTaskComplete AND instr(1, task.categories, "Complete") = 0 Then
the first one kicks it out quicker if the task has the category. I'm not sure it really matters - so use the one that is less confusing or will be easier to understand weeks down the road when you look at it and think "WTF is this doing."
also, i'm pretty sure you need to save the task to set the category when you use code.
You have
Item.Categories = Item.Categories & ";Complete"
but not item.save
Michael: I don't know if you know the answer, but is there any benefit to using
Set Task = Item
instead of referring to the original task as item in this macro?