
How to set the reminder time for all-day events to other than the default 18 hours
by OShon on Mon 20 June 2011 05:09 in Macro
tags: 18 hours, annoying, appointment, change default, different, macro, reminder
0 comments | Add a comment
tags: 18 hours, annoying, appointment, change default, different, macro, reminder
0 comments | Add a comment
In Outlook user has the ability to define all-day events. By default their reminder time is set to 18 hours prior to 00:00. If the user of MS Outlook works only with that application, it will not be a problem. However when synchronizing Outlook with a PDA, mobile phone or other device that has a built-in calendar, you can get a message reminding about the event in the middle of the night.
Luckily there is a way to change that without manually editing fields when you create a reminder. Simply use the macro code below.
Sub Check_all_calender_items_and_disable_reminder_if_set_to_18_hours()
'Ruut Brandsma on 12/04/2007
myNamespace = Application.GetNamespace("MAPI")
Application.ActiveExplorer.CurrentFolder = myNamespace.GetDefaultFolder(olFolderCalendar)
For Each item In Application.ActiveExplorer.CurrentFolder.Items
With item
If .Class = olAppointment Then
If .ReminderMinutesBeforeStart = 18 * 60 And .ReminderSet Then
.ReminderSet = False
.Save()
End If
End If
End With
Next
Application.ActiveExplorer.CurrentFolder = myNamespace.GetDefaultFolder(olFolderInbox)
End Sub
Sub Check_all_calender_items_and_change_18_hours()
'OShon from VBATools.pl
Dim item As Object
With Application.GetNamespace("MAPI")
Application.ActiveExplorer.CurrentFolder = .GetDefaultFolder(olFolderCalendar)
For Each item In Application.ActiveExplorer.CurrentFolder.Items
DoEvents()
With item
If .Class = olAppointment Then
If .ReminderMinutesBeforeStart = 18 * 60 Then
.Start = Format(.Start, "YYYY-MM-DD") & " 9:00" 'optional
.End = Format(.Start, "YYYY-MM-DD") & " 23:59" 'optional
.ReminderMinutesBeforeStart = 0 'option to allow different reminder time h * 60
.ReminderSet = True
.Save()
End If
End If
End With
Next
Application.ActiveExplorer.CurrentFolder = .GetDefaultFolder(olFolderInbox)
End With
End Sub
© All rights reserved. No part or whole of this article may not be reproduced or published without prior permission.