Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Oct 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting task reminders (2000/sp3)

    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

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Setting task reminders (2000/sp3)

    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
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    2 Star Lounger
    Join Date
    Oct 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting task reminders (2000/sp3)

    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..)

    <pre>var olFolderTasks = 13;

    var ol = new ActiveXObject("outlook.application");
    var tasklist = ol.getnamespace("MAPI").getdefaultfolder(olFolderT asks).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();
    </pre>


  4. #4
    2 Star Lounger
    Join Date
    Oct 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting task reminders (2000/sp3)

    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

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Setting task reminders (2000/sp3)

    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>post 564356</post#> 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
    -John ... I float in liquid gardens
    UTC -7ąDS

  6. #6
    2 Star Lounger
    Join Date
    Oct 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting task reminders (2000/sp3)

    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

    <pre>Option Explicit


    Public WithEvents itmsNewTasks As Outlook.Items

    Private Sub Application_Startup()
    Set itmsNewTasks = Outlook.Session.GetDefaultFolder(olFolderTasks).It ems
    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

    </pre>


  7. #7
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Setting task reminders (2000/sp3)

    > Item.ReminderSet = True

    Oops, I missed that altogether! <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

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