How to Auto Mark the Task of a Popup Reminder Complete after a Specific Time Period in Outlook

Some users wish that when a task’s reminder pops up, after a specific time period, Outlook can automatically mark the task complete. Now, this article will introduce a method to realize this function with VBA code.

With accordance to the previous article “How to Auto Dismiss or Snooze Popup Reminders after Several Minutes in Outlook”, you can easily set your Outlook to auto dismiss or snooze popup reminders after a specific time period. However, at times, “Auto Dismiss/Snooze” isn’t the perfect solution to all kinds of items. For instance, if a popup reminder belongs to a task, what you want may be not only dismissing the reminder but also marking this task complete. Undoubtedly, Outlook has no such a function. But, if you have such a requirement, don’t worry, just read on. Here we will teach you achieve it using VBA code step by step.

Auto Mark the Task of a Popup Reminder Complete after a Specific Time Period

  1. At the very outset, start your Outlook program.
  2. Then, access VBA editor by reading to the article – “How to Run VBA Code in Your Outlook“.
  3. Next, copy and paste the following code into “ThisOutlookSession” project.
Public WithEvents objReminders As Outlook.Reminders

Private Sub Application_Startup()
    Set objReminders = Outlook.Application.Reminders
End Sub

'When a Reminder Pops up
Private Sub objReminders_ReminderFire(ByVal ReminderObject As Reminder)
    Dim objTask As Outlook.TaskItem
 
    'If It's a Task's Reminder
    If TypeOf ReminderObject.Item Is TaskItem Then
       Set objTask = ReminderObject.Item
 
       'After 30 seconds
       'Modify 30 as per your needs
       Wait (30)
 
       'Mark Task Complete
       objTask.Complete = True
       objTask.Save
    End If
End Sub

Function Wait(nSeconds As Integer) As Boolean
    Dim dCurrentTime As Date
 
    dCurrentTime = Now
 
    Do Until DateAdd("s", nSeconds, dCurrentTime) <= Now
       DoEvents
    Loop
End Function

VBA Code - Auto Mark the Task of a Popup Reminder Complete after a Specific Time Period

  1. After that, restart your Outlook to activate this project.
  2. From now on, every time when a task’s reminder pops up, after the specific period, Outlook will automatically mark the task complete. The reminder will be dismissed as well.Task of Popup Reminder Is Marked Complete

Solve Outlook Problems

Perhaps you have ever encountered multiple troubles in your Outlook, such as frequent error messages, abrupt Outlook crash and painful PST file inaccessibility. In the event of inaccessible PST files, you will definitely proceed to repair PST. In the first place, you can try inbox repair tool. But, more often than not, seriously damaged PST file must be beyond the inner tool’s capability. Hence, At that point, you have no choice but to take aid of a powerful external utility, 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 SQL Server fix and outlook repair software products. For more information visit www.datanumen.com

Leave a Reply

Your email address will not be published. Required fields are marked *