Warning when setting reminders on weekend in outlook 2010

Hi,

After I have setted reminders on weekend in outlook by mistake, I begin to think that it will be usefully if I can get a warning when I set a remainder on weekend. But I don't find the way to do it so far. Is it possible ?
 
Hey,

There is no such fuction in outlook, but you can write VBA codes to do that as a workaround. Here is a macro you can try.

Code:
Public WithEvents objReminders As Outlook.Reminders
Public strMsg, nWarning As Integer

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

Private Sub objReminders_ReminderAdd(ByVal ReminderObject As Reminder)
    Call WarnIfReminderOnWeekend(ReminderObject)
End Sub

Private Sub objReminders_ReminderChange(ByVal ReminderObject As Reminder)
    Call WarnIfReminderAtWeekend(ReminderObject)
End Sub

Private Sub WarnIfReminderAtWeekend(objReminder As Reminder)
    Dim dReminderDate As Date
    Dim objItem As Object
    Dim strItemType As String
    Dim strItemSubject As String

    dReminderDate = objReminder.NextReminderDate
    Set objItem = objReminder.Item
    strItemType = Replace(TypeName(objItem), "Item", "")
    strItemSubject = objItem.Subject
 
    'Check if the reminder is set on Saturday or Sunday
    If Weekday(dReminderDate, vbMonday) >= 6 Then
       strMsg = "The reminder set on " & strItemType & " " & strItemSubject & " is scheduled on weekends. Do you want to remove this reminder?"
       nWarning = MsgBox(strMsg, vbExclamation + vbYesNo, "Check Reminder Date")
       If nWarning = vbYes Then
          objItem.ReminderSet = False
          objItem.Save
       End If
    End If
End Sub
 
Back