October 12, 2020

Outlook: Move Email to secondary Tasks Calendar

In Microsoft Outlook, I like to use a secondary Calendar for planning my Tasks. This has the advantage not to block my main calendar by default (else you have to be careful to mark the appointment as Free) and have a clear split between Meetings and personal Tasks management.
I present here my way to "put" an email into my Tasks calendar in one click without duplicating content and with a real link from the Calendar entry to the original email.  

Background

It is possible to move an email to your calendar if you Flag the email and then drag the tasks to the calendar : it will copy the plain description and have no direct link to the original email.
See for example here.
Also, you could drag and drop the email to your calendar: this will generate a cloned copy in your calendar.
A third way is to use a Quick step to create an appointment and attaching the email to it.

What I am missing in all these approaches is a real link from my Calendar entry to the original Email at the source - and I also want to avoid duplicating content.
I personally really like to have a direct link to the email, because after having done the task I most likely want to reply to the email to inform about the task completion - keeping the thread unbroken.

Moreover, I like to plan such tasks to my secondary Tasks calendar and don't want to be careful to which Calendar I schedule it.

How to setup

You can get the code in my outlook-vba GitHub repository.

You shall get the Utils module including the GetCurrentItem function, Sleep function and CopyAttachments and the Email module including the CopyToTasksCalendar Sub.

Alternatively you can get the full standalone VBA code including all the requires Sub/Functions in this gist.

The CopyToTasksCalendar Sub shall be used in your QAT or ribbon custom button.

See How to add a macro to a button: https://www.youtube.com/watch?v=IzutmC6o2zg from SlipStick

Usage

The default scenario will flag the email and keep it and create a link to the email in the calendar entry. (pretty really cool.)
You could change this behavior in the macro options at the top of the Sub e.g. you can change it to delete the converted email and also be asked to copy or not the attachments.

References


Main code

Main macro/ code is extracted in this Gist

A tricky part in the macro is to copy the Email HTML body to the appointment item: you can not directly write/copy the body of an appointment in HTML format (but you can for an email). The trick I use is to use a temporary Email item and copy/ paste the body of this email to the appointment using the WordEditor object. 

The macro will also flag the original email as "Follow-up in Calendar".

The Destination Calendar is hard-coded at the beginning of the macro and is named "Tasks"

Set CalFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Folders("Tasks")

No comments:

Post a Comment