View Full Version : macro to set task reminder date to equal task start date
Is it possible write a macro that triggers the reminder date on an Outlook task to reset to the same as the start date? I would like to be able to change the start date on a task and have the reminder date automatically change to match the start date (with a reminder time of 9:00 AM). I would also like to prevent the due date from changing when the start date is updated.
I would be immensely grateful to anyone who can help me with a script for this. Thank you!
gmayor
07-17-2016, 04:45 AM
The following macro will change the start date to the indicated date and set the reminder at 0900 on that date. The due date remains the same.
Sub ChangeTaskDate()
Dim olTask As TaskItem
Dim strStartDate As String
Dim dDueDate As Date
On Error GoTo err_Handler
If TypeName(ActiveExplorer.Selection.Item(1)) = "TaskItem" Then
Set olTask = ActiveExplorer.Selection.Item(1)
With olTask
dDueDate = .DueDate
strStartDate = InputBox("Edit or enter the new start date", "Change Task Start", .StartDate)
If strStartDate = "" Then GoTo lbl_Exit
.StartDate = Format(strStartDate, "Short Date")
.DueDate = dDueDate
.ReminderSet = True
.ReminderTime = .StartDate & " 09:00:00"
.Save
End With
Else
MsgBox "Select a task first!"
End If
lbl_Exit:
Set olTask = Nothing
Exit Sub
err_Handler:
Err.Clear
GoTo lbl_Exit
End Sub
Thanks so much! That works great! Is there any way to trigger it to run automatically when the start date is changed on a task, or will i always have to run the macro manually?
gmayor
07-19-2016, 11:16 PM
I don't know a way to do this automatically.
oh ok. thank you so much for your help!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.