If you frequently need to create another follow-up task after completing a specific task, you can automate this via Outlook VBA. This article will expose the elaborate VBA code to you.
In general, to get a series of related tasks in your Outlook, you can opt to enable “Recurrence” feature on tasks. That is to say, you can create a recurring task. It is indeed convenient. However, by this means, the start and due dates of all the task series will be scheduled in advance. So, if you always wish to manually specify the start date and due date instead of fixed, a recurring task may not be a good choice. But manually creating isn’t suggested either. Hence, here comes a requirement that Outlook can auto create and display a new follow-up task after completing a specific one. Although Outlook has no such a feature, fortunately, you can apply Outlook VBA to realize it. Now read on to get the detailed steps and code.
Auto Create a New Follow-up Task After Completing a Specific One
- At the very outset, start your Outlook program.
- Then you can press “Alt + F11” key shortcut to open VBA editor.
- In the next “Microsoft Visual Basic for Applications” window, you ought to open the “ThisOutlookSession” project.
- Subsequently, copy the following VBA codes into this project.
Public WithEvents objTasks As Outlook.Items Private Sub Application_Startup() Set objTasks = Outlook.Application.Session.GetDefaultFolder(olFolderTasks).Items End Sub Private Sub objTasks_ItemChange(ByVal Item As Object) Dim objCurrentTask As Outlook.TaskItem Dim objFollowUpTask As Outlook.TaskItem Dim strSubject As String 'Change the specific conditions as per your own case If InStr(Item.Subject, "DataNumen Outlook Repair Project") > 0 Then Set objCurrentTask = Item 'Create a new task after completing the current one If objCurrentTask.Complete = True Then Set objFollowUpTask = Outlook.Application.CreateItem(olTaskItem) 'You can change the new follow-up task details to your own needs With objFollowUpTask .Subject = "DataNumen Outlook Repair Project" & vbTab & Format(Now, "DD/MM/YYYY hh:mm") .Body = objCurrentTask.Body .attachments.Add objCurrentTask .Display End With End If End If End Sub
- After that, assign a digital certificate to the current macro.
- Later confirm that your Outlook is set to permit signed macros.
- Finally, you can restart your Outlook to activate the new macro.
- From now on, every time after you mark the specific task as complete, a new follow-up task will display with the original one attached.
What if Encountering Outlook Crash
When your Outlook crashes suddenly, you can firstly restart it. In general, you’ll still be able to access your Outlook data successfully. But if you fail, you can then recur to the internal Outlook fix tool, which can solve some PST issues with ease. Nevertheless, assuming it fails too, you have no alternative to use a more potent tool like 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 mdf repair and outlook repair software products. For more information visit www.datanumen.com
Leave a Reply