• Setting task reminders (2000/sp3)

    Author
    Topic
    #430597

    I’ve got a Sony CLIE’ (PalmOS) pda, and use it to add “tasks” for myself while in meetings. I then sync it with my work computer periodically..

    I have noticed, however, that although I can put a “Due Date” for the task, it does NOT set a reminder. Therefore the very reason I put it in my PDA (because I will forget to do the task) doesn’t help me much ’cause my PDA doesn’t beep at me that I have a task to do! (I know this may sound silly and trivial (“just check your PDA, stupid.”), but hey, for a guy with little to no useful memory, it’s a growing problem.

    Is there something that already exists, or an easy routine that I could run periodically to go through and set reminders for tasks that have a due date but no reminder set?

    thanks so much!
    ..dane

    Viewing 0 reply threads
    Author
    Replies
    • #1005927

      You may be able to do this automagically. Put the attached code in your ThisOutlookSession Module in the Outlook Visual Basic Explorer. Only problem is, I do not know if Syncing will trigger this code

      • #1005932

        Thanks for the reply, John.

        I tried your suggestion, but it did not trigger during a HotSync.

        I also have tried the following using jScript, but the .Save(); event seems to not be working. It does not report an error, but it does not update the Tasks items either… Not sure how easy it would be to convert to VBScript, and if it would even help. (My thinking is to just run this as a scheduled task every hour to go through my task list within Outlook..)

        var olFolderTasks    = 13;
        
        var ol = new ActiveXObject("outlook.application");
        var tasklist = ol.getnamespace("MAPI").getdefaultfolder(olFolderTasks).items;
        var task;
        
        for (var i = 1; i < tasklist.Count; i++)
        {
           task = tasklist.item(i);
        
           if ((task.ReminderSet != true) && (task.DueDate != null) && (task.Complete == false))
           {
              task.ReminderSet = true;
              task.ReminderTime = task.DueDate;
              task.Save();
           }
        }
        WScript.Quit();
        
        • #1005935

          Correction!

          Since I already had Outlook open, I didn’t have the event handler registered. Manually running the _Startup() routine did trip upon HotSync’ing with my PDA. Wahoo!

          Now one last little problem. Setting to 8:30AM, if set to the current day, inherently cancels the reminder (it has already passed). You indicated that “17/48” equates to 830am of the date desired. How did you come up with that equation?

          It would be nice to set to 8am on the date due (if not today or previously due), but to set to, say, today in 1 hour, if the due date is set to today or some previous date.

          Can you help me understand the .Date format better to accomplish this task?

          thanks so much,
          ..dane

          • #1005944

            Good, after I got your Post I realized I had forgotten to advise that Outlook must be closed and reopened for the Event to be hooked.

            Task times are a bit odd – in post 564356 I could not find a way to set or display a time under Due Date, only for Reminder Time. It does seem an oversight that Times can’t be set under Due Date.

            In VBA time is fractions of a day: 1/2 the day = noon, 8/24ths of the day = 1/3rd of the day = 8:00 AM, and 17/48ths of the day is 8:30 AM. Or, there are 24 x 60 = 1440 minutes in a day, so 5 minutes is 5/1440 (or 1/288 if like incomprehensible code). You can tweak this to set your own Reminder Time.

            The easy way would be something like (untested, you may need to clean it up):

            Private Sub itmsNewTasks_ItemAdd(ByVal Item As Object)
            Dim dateReminder as Date
            If Item.Class = olTask Then
            If Item.DueDate + 17/48 >= Now Then ‘ the time that this task was added is past 8:30 AM
            dateReminder = Now + 1 / 1440 ‘ a minute from now
            Else
            dateReminder = Item.DueDate + 17 / 48 ‘ 8:30 AM that day
            End If
            Item.ReminderTime = dateReminder
            Item.Save
            End If
            End Sub

            • #1005951

              Hey John. I did some playing in the “Watch” area with “Now + x / y” and determined how it worked. I made some modifications to your code, but post it here for a permanant reference for those in the future looking for something similar.. Also, had to set ReminderSet to true…

              thanks so much!
              ..dane

              Option Explicit
              
              
              Public WithEvents itmsNewTasks As Outlook.Items
              
              Private Sub Application_Startup()
                  Set itmsNewTasks = Outlook.Session.GetDefaultFolder(olFolderTasks).Items
              End Sub
              
              Private Sub itmsNewTasks_ItemAdd(ByVal Item As Object)
                  If Item.Class = olTask Then
              
                      ' I had to compare against the date "1/1/2500" because 
                      ' my PDA sets the equivelant date of "no due date" to 1/1/4501.
                      ' Thinking that was just too far out, I scaled back my test to year 2500.
                      ' If anyone in that time is using this script, I will feel pitty for them, 
                      ' for it will break..
              
                      If (Not (Item.ReminderSet)) And (Not (IsNull(Item.DueDate))) And _
                          (Not (Item.Complete)) And (Item.DueDate < DateSerial(2500, 1, 1)) Then
                          
                          ' If the due date is before 'NOW' (plus some time) then 
                          ' bump the reminder so that Outlook does not cancel
                          ' the reminder altogether.
              
                          If (Item.DueDate < (Now + ((1 / (24 * 60)) * 15))) Then
                              Item.ReminderTime = Now + ((1 / (24 * 60)) * 15)    ' due in 15 min
                          Else
                              Item.ReminderTime = Item.DueDate + (8 / 24)         ' due 8am that day
                          End If
                          
                          Item.ReminderSet = True
                          Item.Save
                      End If
                  End If
              End Sub
              
              Private Sub Application_Quit()
                  Set itmsNewTasks = Nothing
              End Sub
              
              
            • #1005958

              > Item.ReminderSet = True

              Oops, I missed that altogether! laugh

    Viewing 0 reply threads
    Reply To: Setting task reminders (2000/sp3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: