I’ve seen several tweets lately like these two from TornadoTwins and seanblezard (respectively).
I really don’t see any reason for #Microsoft #Outlook to remind you of meetings in the past. Boy is this piece of software a mess.
Why the hell is my work Outlook calendar reminding me about meetings that are 110 weeks overdue!
They make a good point. What’s the value in Outlook reminding you about something that occurs in the past? Especially if the appointment occurred 110 weeks (more than two years) ago. I can see where that’d be annoying.
Scripting to the rescue. While Outlook lacks a built-in setting that eliminates past due reminders, it’s very simple to script their elimination. Here’s the code for doing that. This code is designed to run each time you launch Outlook. All it does is go through the existing reminders and compare the current date/time to the date/time set in the reminder. If the current date/time is greater, then the reminder occurs in the past and the code dismisses it. This does introduce a risk that you’ll miss a reminder that was set to go off just before you launched Outlook. For example, you had a reminder set to go off at 8:45 for a 9:00 meeting. You launch Outlook at 8:50. The code cancels the reminder and you miss the appointment because you launched Outlook five minutes too late. To prevent that from happening I’ve given you the option to set a grace period to honor reminders with a set number of minutes of Outlook launching. By default the grace period is 60 minutes. That is, any reminder that would have occurred within 60 minutes of Outlook launching won’t be cancelled. If 60 minutes is too long, or not long enough, then you can change the grace period to whatever you want it to be. Just remember the grace period is in minutes.
Instructions.
Outlook 2003 and Earlier.
- Start Outlook
- Click Tools > Macro > Visual Basic Editor
- If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
- Copy the code from the Code Snippet box and paste it into the right-hand pane of
- Outlook’s VB Editor window
- Edit the code as needed. I included comment lines wherever something needs to or can change
- Click the diskette icon on the toolbar to save the changes
- Close the VB Editor
- Click Tools > Macro > Security
- Set the Security Level to Medium
- Close Outlook
- Start Outlook
- Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run. Say yes.
Outlook 2007.
- Start Outlook
- Click Tools > Macro > Visual Basic Editor
- If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
- Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook’s VB Editor window
- Edit the code as needed. I included comment lines wherever something needs to or can change
- Click the diskette icon on the toolbar to save the changes
- Close the VB Editor
- Click Tools > Trust Center
- Click Macro Security
- Set Macro Security to “Warnings for all macros”
- Click OK
- Close Outlook
- Start Outlook. Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run. Say yes.
Private Sub Application_Startup() KillOverdueReminders End Sub Sub KillOverdueReminders() ' Purpose: Kills all reminders for past due appointments.' ' Usage: Run at Outlook startup to eliminate reminders on appointments that occur in the past.' ' Written: 4/1/2011' ' Modified: 11/30/2011' ' Author: David Lee' ' Outlook: All versions' Const GRACE_PERIOD_MINUTES = 60 Dim olkReminders As Outlook.Reminders, olkReminder As Outlook.Reminder, intCount As Integer, intIndex As Integer Set olkReminders = Application.Reminders intCount = olkReminders.Count For intIndex = intCount To 1 Step -1 Set olkReminder = olkReminders.Item(intIndex) If olkReminder.Item.Class = olAppointment Then If DateAdd("n", GRACE_PERIOD_MINUTES * -1, Now) > olkReminder.NextReminderDate Then olkReminders.Remove intIndex End If End If Next Set olkReminder = Nothing End Sub
I entered a question yesterday, but I put it in “ABOUT”. I suspect that may have been the wrong place. I have perused the comments here, but found nothing similar.
I found your VB program KillOverdueReminders. It works just as you said it would. Fantastic!!! Your directions were perfect. I would like to kill reminders based on the APPOINTMENT date and time rather than the REMINDER. It appears to me that I need to replace “olkReminder.NextReminderDate” with a different variable. Can you tell me what it is in Outlook 2007 and how to do that?
Happy Holidays!
Art
Hi, Art.
This solution kills reminders that occur in the past, leaving future reminders intact. If instead you want to kill all reminders for appointments with a start date that falls into some date range, then you can use something like this. It will clear the reminder setting on all the appointments that fall into whatever date range you specify.
David,
Your solution requires me to input a date range. What I want to do is pretty much the same as the KillOverdueReminders program, except I want it to automatically kill all reminders for APPOINTMENT start dates older than NOW (the time I access Outlook). I really don’t care what the reminder date was set to. I don’t know the correct syntax, but I think you could just change line 19/20 to read
If DateAdd(“n”, GRACE_PERIOD_MINUTES * -1, Now) > APPOINTMENT START DATE Then olkReminders.Remove intIndex
That would accomplish what I want.
It also avoids the problem that some reminders are set for 2 weeks and some for 2 hours before the appointment. Who cares? If the appontment was yesterday, I don’t need a reminder. If the appointment is tomorrow, I want the reminder to stay. Your original program will kill a reminder for tomorrow’s appointment if the reminder was set to start yesterday.
I like the grace period idea. I would probably set it to 0, but others might want to keep reminders for appointments that occurred in that last 12 hours or whatever.
Art,
Okay. Try this version.
David,
Thanks for working on this for me, but I am not even able to make it run. For me this was really more of an intellectual exercise than a real software problem, so I will just let it go. If YOU have any reason to want to pursue it, you have my email address.
Thanks again.
Hi, Art.
I’ve just emailed you.
Hello –
I’m trying this code but getting a compile error on the second line of the 3 lines which call the code. (Compile error: Sub or Function not defined). I think I’m using Outlook 2016. The window label says VbaProject.OTM[break] – ThisOutlookSession (Code)], so I’m pretty certain I’ve placed this code in the “ThisOutlookSession” module. Thanks!
Dan S.
Hi, Dan.
Is all the code there? When looking at the code in the VB editor in Outlook do any of the lines have numbers in front of them?
Hi Dave.
There are some subject-perishable appointments that I definitely would like to disable overdue reminders. However, for some appointments I would want to be reminded even after their time has passed. Is there any way of applying your macro whileI enter the appointment in Outlook, so I can control the reminder behavior? Thanks, Haim
Hi, Haim.
The simplest solution I can think of is to use a category as a filter. Appointments that belong to the category won’t have their reminders dismissed, while that don’t belong to the category will have their reminders dismissed. Something like this.
Dave – Thanks so much for this thread. Question – I’d like to disable past reminders for meetings only. Not for tasks, or flagged message reminders. Is there a way other than using category definitions to filter by the type of reminder?
Hi, Scott.
The code only disables appointment/meeting reminders. It already avoids removing reminders on other item types.
Thanks for the quick response David – I was actually asking about the continuous monitor macro, not the startup macro. I just replied to the appropriate sub-thread with this question.
Hi, Scott.
Got it. Replace the olkRem_ReminderFire subroutine with the version below.
David, here’s your code with a one-line mod for Outlook 2010.
Thanks, Rick. It looks like the only change is to the GRACE_PERIOD_MINUTES constant. You changed it from 60 minutes to 1440 minutes which is 24 hours. Was that it?
Line 18 as well. olkReminder.Item.Class becomes olkReminder.Application.Class . 1440 = 2 days.
Great thread. I tried the macro in Outlook 2013 and it works to kill overdue reminders, but in order to do so I have to click it under the “macros” menu in the dev. tab which is more of a hassle than simply clicking dismiss when the reminder shows up. Is it possible to make the script run automatically every time I get an overdue reminder so that they are all automatically killed or dismissed? Thank you!
Hi, John.
Thanks, I’m glad you like it.
If the code is installed per the instructions, then there’s no need to run it manually. It should run each time you launch Outlook and kill all overdue reminders up to that point. However, it does not continue to dismiss reminders throughout the day. If you’d prefer a solution that continuously monitors reminders and dismisses those that are overdue, then I can whip up a version that does that.
Ah, I see. Yes, a version that continuously monitors and dismisses overdue reminders throughout the day would be awesome. Let me know if you come up with something. Thanks again.
Hi, John.
Please try this version. I’ve not tested it, but it should dismiss any overdue reminder when the reminder fires. The code must go in the ThisOutlookSession module in Outlook.
I tried copy/pasting the code into developer/project1/microsoft outlook objects/ThisOutlookSession and it appears as:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Const GRACE_PERIOD_MINUTES = 60
Dim WithEvents olkRem As Outlook.Reminders
Private Sub Application_Quit()
Set olkRem = Nothing
End Sub
Private Sub Application_Startup()
Set olkRem = Application.Reminders
End Sub
Private Sub olkRem_ReminderFire(ByVal ReminderObject As reminder)
If ReminderObject.NextReminderDate < DateAdd("n", GRACE_PERIOD_MINUTES * -1, Now) Then
ReminderObject.Dismiss
End If
End Sub
When I save and exit I get "Compile error: Invalid outside procedure"
Hi, John.
When you selected the code you got the line numbers too. There shouldn’t be any line numbers.
Does not work at all. I’ve tried the script you posted and the fix you offered here. Neither works. Actually the “comment fix” is invalid somehow and returns an error: “Compile error: Invalid attribute in Sub of Function” which I think refers to this: WithEvents olkRem As Outlook.Reminders
So what next?
Hi, Johnny.
The error “Invalid attribute in Sub or Function” tells me that the code is not in the ThisOutlookSesssion module. The code must be in that module to work.
David – how would you modify the continuous-monitor macro so that it only monitors for appointment reminders, not Task or flagged-message reminders?
It works in Outlook 2013! Thanks.
Something I’d like to comment:
1. I cannot find a mouse-clicking way to reveal the Visual Basic Editor, but a hot key combination “Alt+F11” does the trick.
2. Still the menu stuff, I don’t know how to find the “Tools” menu, but the trust center setting is available at: File –> Options –> Trust Center –> Trust Center Settings…. And for the “Macro Settings” option, there are 4 option values to choose from:
[ ] Disable all macros without notification
[ ] Notifications for digitally signed macros, all other macros disabled (this seems to be the default)
[X] Notifications for all macros
[ ] Enable all macros (not recommended; potentially dangerous code can run)
I think the best option is the 3rd one. But is there a way to allow this specific macro run silently upon start up?
And thank you again for this script. I like using Calendar to do memo notes, and those notes usually are recorded in the past, this script can help me get rid of that reminders windows with bunch of OVERDUE events.
Hi, raizeox.
I cannot find a mouse-clicking way to reveal the Visual Basic Editor, but a hot key combination “Alt+F11″ does the trick.
To click your way to the editor you’ll need to add the Developer tab to the ribbon. Once you’ve done that, switch to the Developer tab and then click the “Visual Basic” button.
Still the menu stuff, I don’t know how to find the “Tools” menu, but the trust center setting is available at: File –> Options –> Trust Center –> Trust Center Settings
The “Tools” menu was available in Outlook 2007. I should probably update the instructions for Outlook 2010 and 2013.
I’m glad you like the script.
Script works great! One little problem: If I have a RECURRING reminder, it does not delete past occurrences. . I’m not much of a VBA programmer. I know it has something to do with Outlook.RecurrencePattern, but I can’t figure out what. Any ideas?
Hi, Ron.
Recurrence patterns don’t come into play here. Reminders is a separate object collection that contains just the reminders. I’ll need to run a test to see what’s going on. I’ll be back in touch as soon as I know more.
Ron,
Just to confirm, the reminder is for an appointment, right?
Do you have any solutions for Outlook 2010, SP2 MSO?
Hi, Stephan.
The solution will work with Outlook 2010. Just follow the instructions for Outlook 2007.
Pingback: Fix Outlook Reminders Not Working | OutlookRecoveryGuide.org
Do you have a fix for outlook 2011 for mac?
I’m afraid not. I’m not a Mac user myself and don’t do any work on that platform. Sorry.
This code does not work. It starts up debugger on the line that says if bla bla =olAppointment. shouldn’t this be olkAppointment or so ??? Even when changing that I get ‘operation fails’ when I try to run the macro. Stupid.
Hi, Danny.
Are you talking about this line?
If so, then no, it should be olAppointment, not olkAppointment. I’ve tested the code and others are using it successfully too, so I’m confident it works correctly. What error are you getting?
It does work when I change the intIndex loop to go downto 2 iso 1 though.
Sorry I think I hooked my reply to the wrong message here maybe, so here it is again:
When I restart Outlook, the macro immediately is stopped by the debugger. Further investigation showed that the debugger seems to stop during the last iteration, hence my ‘solution’ to change the lower limit of the loop to 2 iso 1.
Danny,
What’s the error? If I knew that, then I might be able to suggest a fix other than the one you’re already using.
The only thing I see is a message box that says: “the operation failed”. This is when i run the macro from the tools menu. When I close Outlook and start it again, the window opens and the debugger colours the line with the ‘olAppointment’ yellow. BTW, even with my ‘fix’, i’m still getting reminders of old events. Well, just one event, maybe that is the one I missed by changing the loop counter, but the loop fails during its last iteration. I’m running Outlook 2007 on an XP machine.
I am going to close the page where these comments reside now. I will probably never be able to find it back, so I won’t be reading your ‘solution’, but then again, after 3 days, it doesn’t matter anymore cause my experience is if I don’t see replies in 3 days, they never come.
Danny,
I apologize if I seem slow to respond. I do this in my spare time and I haven’t had much of that for the last several days.
While I don’t doubt that you’re getting an error, I don’t see any reason why that should happen. Especially on the line you reported. All that line is doing is testing to see if the calls of the item that triggered the reminder equals olAppointment. olAppointment is a constant defined by Outlook. An “operation failed” error usually occurs when calling a method or procedure. There is no such call on that line. Just to be clear, I’m assuming that this is the line the debugger is highlighting.
Are you sure the code copied over okay?
David:
After 3 hrs with an AppleCare tech, we figure out that the act of dismissing overdue reminders causes my iPhone to fail to sync when it tries to sync the Calendar – it is a perpetual do-loop and I have to unplug or Force Quit iTunes. I want to disable the Reminder function. Is there a painless way (for a non-techie)?
Hi, gpnord.
If you’re using a Mac, then I’m afraid I cant help. I don’t have any experience with Macs. If instead you’re using a PC, then what do you mean by “disable the Reminder function”? Disable it how and on what, your computer or your iPhone?
Sorry, forgot to say – using MS Outlook for Mac on my MacBook.
I wish I could help, but I’ve no experience with Macs or Outlook on a Mac. I’m strictly a PC guy. Sorry.
When I restart Outlook, the macro immediately is stopped by the debugger. Further investigation showed that the debugger seems to stop during the last iteration, hence my ‘solution’ to change the lower limit of the loop to 2 iso 1.
darn- your reply showed up after my request for the code. Sorry.
(feel free to delete my redundant comments)
OK, I appear to be stumped. How do I create a task which calls a macro?
Thanks again for helping, and I apologize for bugging you.
David — nice script. I have one question: I pretty much never log off, and would like this script to run automatically, say once a day. Is there an easy way to do that?
thanks
carl
Thanks, Carl! I’m glad you like the script.
There are a couple of ways to accomplish this. First, we could have Outlook run the script automatically by creating a recurring task that triggers it. That would take more code, but it keeps the process entirely within Outlook. Second, I can create a version of the script that runs outside of Outlook. You could then schedule it using Windows Task Scheduler. That would not require more code, just a modification of the existing code, but would take the process out of Outlook. Which do you prefer?
Hi David,
I agree that keeping the script “inside” Outlook is cleaner. I could do that myself (I can do *some* VB scripting 🙂 ). Something like:
Sub killrem()
Dim nextgo As Date
nextgo = DateAdd(“d”, 1, Now)
rightnow = Now
Do While True
foo = rightnow – nextgo
If (rightnow > nextgo) Then {{ run your script}}
Start = Timer
Do While Timer < Start + 1
DoEvents
Loop
rightnow = Now
Loop
End Sub
Although rather than a CPU-wasting loop, I'll create an Outlook recurring task as you suggested..
Thanks again.
Carl,
Here’s how to do this in Outlook using a task as the trigger.
Replace “Kill Old Reminders” on line #15 with a subject of your choosing. If you set the task to recur, then this will happen each day at whatever time you set the task reminder to fire.
Hi David, I’ve got this overdue reminder problem and tried your script per the instructions but on re-starting Outlook (step 13), I don’t get the dialog box you identify and within a minute or so of re-opening Oultook, my overdue reminders re-appear.
Any ideas?
Thanks
What version of Outlook are you using, Matt?
Hi David, is Outlook 2007
Just to clarify, the code is in ThisOutlookSession and you have enabled macros in the Trust Center. Correct?
Hi David, I followed the instructions to the letter. I’m not a developer, so step 5 i ignored… wouldn’t know what to edit!
Matt,
Ok. I had to make sure. Are you able to run the KillOverdueReminders macro manually?
Not sure what you mean re running manually…. how do I do that?
Matt,
Click Tools > Macro > Macros. Select and run the KillOverDueReminders. I don’t have a copy of Outlook 2007 anymore so I’m doing this from memory and am not certain this is the right sequence.
In Tools > Macro > Macros >…. the Kill Overdue Reminders does not appear as a macro to select…
Try moving that macro out of ThisOutlookSession and into a module.
For anyone not a programmer, you’ll find that when cutting and pasting the snippet the line numbers may be carried over. Delete those and save the code; it resolved my run-time error problem
You can also avoid the line numbers by clicking the second icon from the left that appears in the upper right-hand corner of a code window when you mouse into it. This copies the code to the clipboard allowing you to paste it into Outlook.
What are the steps for Outlook for Mac – as I couldn’t find the Visual Basic Editor. Thanks.
Hi, Rajesh.
These scripts are only for Outlook on Windows. Unfortunately, the Mac version of Outlook does not have a Visual Basic capability.
“The operation failed.” Should be between the “” on that first line.
I am a novice programmer at best but I do understand methods, functions, and I can read and understand code fairly well,
The problem is just hangging up on this argument,
If DateAdd(“n”, GRACE_PERIOD_MINUTES * -1, Now) > olkReminder.NextReminderDate Then
And the operations is failing on olkReminder.NextReminderDate it seems like, even though it has no problem recognizing olkReminder, I was thinking the problem was comming from the .NextReminderDate. Like maybe outlook 2010 called it something else?
The problem appears to be that some reminders are showing up blank (i.e. none of their properties are filled in including NextReminderDate). At first I thought reminders were corrupt, but launching Outlook with the /cleanreminders switch doesn’t make them go away, so it must be something else. I’m researching why and will work out a solution.
hi David, I tried your code in Outlook 2007 (Win 7) but get a runtime error for the same line as mentioned above :
If DateAdd(“n”, GRACE_PERIOD_MINUTES * -1, Now) > olkReminder.NextReminderDate Then
I noticed that you’re working on a solution. Did you have a chance to fix it as this code will be very helpful for me.
Hi, James.
I just updated the code. Please try it now and let me know what happens.
hi David,
I’ve tried it out for some days now and I’m not sure if it works exactly as I expect it to work.
Could it be that reminders are still popping up within 1h after the actual start time ?
Hi, James.
Unless you’ve changed the grace period
Const GRACE_PERIOD_MINUTES = 60
then the code doesn’t touch appointments that are 60 minutes or less old. You can change the grace period to be anything you want it to be. If you want to clear the reminder for any past due appointment regardless of age, then set the grace period to 0. Note that doing this means you won’t get a notification for an appointment that was supposed to start 1 minute before you opened Outlook.
Justin,
I beliieve I’ve fixed the problem. Please download the revised code and give it a try.
Wow, thx so much. Works like a charm.
You’re welcome, Justin!
I am getting a “” on
If DateAdd(“n”, GRACE_PERIOD_MINUTES * -1, Now) > olkReminder.NextReminderDate Then
only when I mouse over
olkReminder.NextReminderDate
I am using Win7/Outlook 2010 Any help would be appreciated.
Hi, Justin.
“only when I mouse over olkReminder.NextReminderDate”
What happens when you mouse over that?
It says “olkReminder.NextReminderDate = The Operation Failed.” when I mouse over.
Are you manually running the code or does this occur when the code is triggered?
I set it up as a macro, then try and run it. the debugger stops me from there and highlights that line of code. If I close out of outlook and reopen, then I get an error message that asks me to debug, highlighting the same code.
How familiar are you debugging VBA code?
Hi,
thanks for the script. But for me (with Outlook-2003, SP3 under Win7) the original script causes Outlook to crash on exit if there are no overdue appointments at all. We should add a Null check before accessing the Class property. So the loop contents looks like:
Set olkReminder = Outlook.Reminders.Item(intIndex)
If olkReminder Null Then
If olkReminder.Item.Class = olAppointment Then
If DateAdd(“n”, GRACE_PERIOD_MINUTES * -1, Now) > olkReminder.NextReminderDate Then
olkReminder.Dismiss
End If
End If
End If
Unless it solves that annoying overdue message problem, it introduces the security warning message asking to enable / disable macros every time I start Outlook. Up to now I didn’t find a way to tell Outlook “I trust THIS macro and want you to execute it silently” without having to disable this security warning globally.
Any ideas? 🙂
regards,
Joe
Hi,
thanks for the script. But for me (with Outlook-2003, SP3 under Win7-64) the original script causes Outlook to crash on exit if there are no overdue appointments at all. We should add a Null check before accessing the Class property. So the loop contents looks like:
Set olkReminder = Outlook.Reminders.Item(intIndex)
If olkReminder Null Then
If olkReminder.Item.Class = olAppointment Then
If DateAdd(“n”, GRACE_PERIOD_MINUTES * -1, Now) > olkReminder.NextReminderDate Then
olkReminder.Dismiss
End If
End If
End If
Unless it solves that annoying overdue message problem, it introduces the security warning message asking to enable / disable macros every time I start Outlook. Up to now I didn’t find a way to tell Outlook “I trust THIS macro and want you to execute it silently” without having to disable this security warning globally.
Any ideas? 🙂
regards,
Joe
Hi, Joe.
I don’t have a computer with Outlook 2003 on it so I cannot test your configuration. While I don’t doubt that Outlook is crashing on exit I don’t see how this code can be the cause. The code only runs at startup, not at shutdown. You can test that by setting a breakpoint in the code. There’s also no need to test for nulls because the FOR … NEXT loop (i.e. For intIndex = Application.Reminders.count To 1 Step -1) only processes if there are in fact reminders present. If there aren’t any reminders, then the script falls through and exists without doing anything. That means the scrip only runs if at least one reminder is present, in which case the reminder cannot be null.
The warning message about macros can be eliminated by signing the macro with a self-cert. Here’s a page that describes how to do that: http://office.microsoft.com/en-us/outlook-help/add-a-digital-signature-to-a-file-or-macro-project-HP005249557.aspx
Thanks. it actually worked for me.
You’re welcome, Harrold!