When creating a new task in Outlook, if you frequently need to set today as its start date, you must wish Outlook to auto accomplish it. This article will look at this requirement to provide an easy method.
By default, when you click create a new task in your Outlook, the task will display with “Start date” set to “None”, as shown in the following figure. However, more often than not, you’re accustomed to setting the start date to the current date. So, you have to manually input or select the date in “Start date” field. In face of such a scenario, you may hope that Outlook can automatically preset today as the start date pf new task. Though there is not such a direct function, you still can get it by the shared VBA code thereinafter. If you are not familiar with VBA, please refer to “How to Run VBA Code in Your Outlook” meanwhile.
Auto Preset Today as the Start Date of a New Task
- To begin with, launch your Outlook application.
- Then, press “Alt + F11” to trigger Outlook VBA editor.
- Next, copy the following code into the “ThisOutlookSession” project.
Public WithEvents objInspectors As Outlook.Inspectors Public WithEvents objTask As Outlook.TaskItem Private Sub Application_Startup() Set objInspectors = Outlook.Application.Inspectors End Sub Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector) If TypeOf Inspector.CurrentItem Is TaskItem Then Set objTask = Inspector.CurrentItem End If End Sub Private Sub objTask_Open(Cancel As Boolean) 'When opening a fresh new task item If Len(objTask.Subject) = 0 And Len(objTask.Body) = 0 And objTask.startDate = #1/1/4501# And objTask.DueDate = #1/1/4501# Then 'Set start date to today objTask.startDate = Date End If End Sub
- After that, move the cursor to the first “Application_Startup” subroutine.
- Later, press “F5” key button.
- Since then, every time when you create a new task, Outlook will auto set the start date to the current date, namely today, as shown in the following image.
Beware of Malicious Macros in Outlook
Although VBA macro brings a lot of convenience and possibilities to users, it also leads to many potential risks. For instance, if you set your macro settings to allow all macros without notification, when an email with malicious macros arrives in your mailbox and you open its embedded links, your Outlook data file tends to be attacked by viruses. At that time, you have to kill the viruses and attempt Outlook repair. Most of time, the inbuilt tool – Scanpst cannot be up to this assignment. So, you ought to call in a more robust utility, such as DataNumen Outlook Repair.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql recovery and outlook repair software products. For more information visit www.datanumen.com