Link to home
Start Free TrialLog in
Avatar of tobey1
tobey1Flag for United States of America

asked on

Clearing Completed Tasks via a script

I like to use Outlook Today and Tasks, but once a task is completed, I don't want it to show in Outlook Today.  I would like to craft a script to move completed tasks from the Task folder to a folder called "Task-Completed".  Can someone help me get started with this?
Avatar of peakpeak
peakpeak
Flag of Sweden image

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
Avatar of tobey1

ASKER

I tried the above, and it keeps resolving the destination folder to nothing.

Set olkTaskArchive = OpenOutlookFolder("\\Mailbox - Last, First\Tasks\Tasks-Completed")

Am I missing something?
Avatar of tobey1

ASKER

Thanks...that worked when I got rid of the \\ before Mailbox.

Any way to get this to run automatically?
When you say "automatically" what do you have in mind?  When Outlook opens or closes, timed, or something else?
Avatar of tobey1

ASKER

either on Open/Close or when the Task is marked closed.
It's easy to do it when opening/closing Outlook.  Add the code below to the ThisOutlookSession module.  It'll run the first macro each time Outlook starts.
Sub Application_Startup()
    MoveCompletedTasks
End Sub

Open in new window

Avatar of tobey1

ASKER

Thanks again for your help!
You're welcome!