Consulting

Results 1 to 5 of 5

Thread: macro to set task reminder date to equal task start date

  1. #1
    VBAX Regular
    Joined
    Jul 2015
    Posts
    9
    Location

    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!
    Last edited by LyPy; 07-16-2016 at 04:52 PM.

  2. #2
    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
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Regular
    Joined
    Jul 2015
    Posts
    9
    Location
    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?

  4. #4
    I don't know a way to do this automatically.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  5. #5
    VBAX Regular
    Joined
    Jul 2015
    Posts
    9
    Location
    oh ok. thank you so much for your help!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •