Outlook allows users to flag emails with a custom follow-up reminder and due date. But you need to select and enable it manually. This article will teach you how to achieve it automatically via VBA.
Outlook provides us with the “Flag” feature, which can let us follow up the critical emails much more conveniently. Not only can it permit us to make an email, but also it allows us to select a preferred flag icon, assign a specific due date and even specify a custom reminder to the email. Without any doubts, it’s very handy.
But many users still have another desire. They hope that Outlook can auto specify a relatively fixed custom due date and reminder time to the flagged emails, such as 3 days after today, 1 week after today, etc. To be honest, Outlook has no such a native feature. Hence, you need to recur to other means, for instance, VBA. Here we will teach you how to use Outlook VBA to realize this requirement. Read on to get it in detail.
Auto Set a Reminder and Due Date When Flagging an Outlook Email
- At the very outset, launch your Outlook program.
- Then you can press “Alt + F11” key shortcuts to get access to VBA editor.
- Next in the following “Microsoft Visual Basic for Applications” window, you need to double click on “ThisOutlookSession” project on the left side.
- Subsequently, copy and paste the VBA codes below into it.
Public WithEvents objInboxItems As Outlook.Items Private Sub Application_Startup() Set objInboxItems = Outlook.Application.Session.GetDefaultFolder(olFolderInbox).Items End Sub Private Sub objInboxItems_ItemChange(ByVal Item As Object) Dim objMail As Outlook.MailItem If TypeOf Item Is MailItem Then Set objMail = Item If (objMail.IsMarkedAsTask = True) And (objMail.FlagStatus <> olFlagComplete) Then 'You can change the following lines as per your actual needs With objMail .FlagRequest = "Type the custom follow-up notes here" .MarkAsTask olMarkNextWeek 'Set a custom due date .TaskDueDate = Now + 7 .ReminderSet = True 'Set a custom reminder time .ReminderTime = Now + 6.5 .Save End With End If End If End Sub
- After that, you should sign this code as normal.
- Later exit the VBA editor and proceed to change your Outlook macro settings to enable the digitally signed macros only.
- Finally you need to restart your Outlook to activate the new macro. After that, you can have a try.
- Click the flag icon at the tail of an email item.
- At once, the flag will be automatically changed to “Next Week Flag” icon.
- And its due date and reminder time will be set corresponding to your pre-setting in the codes.
Don’t Panic If Encounter Outlook Crash
When Outlook crashes unexpectedly, most people will fear panic in that they fear that their Outlook data will get damaged. But actually if you have made sufficient precautions, you will never panic. The most important measure is to back up PST files regularly. Moreover, you can also recur to a preeminent tool to get back your damaged Outlook data, such as DataNumen Outlook Repair.
Author Introduction:
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql fix and outlook repair software products. For more information visit www.datanumen.com