Results 1 to 11 of 11
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Total time spent on category (Outlook98/WinNT4)

    A bit of weird one, this (at least, it seems so to me!), but still ...

    I have a view in Outlook that groups appointments by category and gives the duration of each appt, but what I need to know is how long I've spent on the appts in each category. Is there a (relatively simple) way to get Outlook to total the durations of the items in the category and display it in the view? (Quick note - although I'm reasonably au fait with XL/Word VBA, I wouldn't know where to start with Outlook VBA!).

    Also, how would you have it display all the appts in the last three months on a rolling basis - ie it always shows the last three months, not by specifying dates? I can find last month but not last three months ...

    Any help would be gratefully appreciated!
    Beryl M


  2. #2
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Total time spent on category (Outlook98/WinNT4)

    <img src=/S/sigh.gif border=0 alt=sigh width=15 height=15> Does the lack of response to this question mean I've found something no-one knows how to do? <img src=/S/sigh.gif border=0 alt=sigh width=15 height=15>

    <img src=/S/sad.gif border=0 alt=sad width=15 height=15> and it would have been so useful, too ... <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15>

    Ah well. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Thanks anyway!
    Beryl M


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

    Re: Total time spent on category (Outlook98/WinNT4)

    <P ID="edit" class=small>(Edited by JohnBF on 19-Jan-04 11:43. )</P>On the second question, did you try Filtering the View for all items Ending After three months ago yesterday (which date you will have to figure out) and Ending on or Before today? Hmm, I can't get it to work.

    I don't know the answer to your first question, if I find time I'll try to develop some simple code.
    -John ... I float in liquid gardens
    UTC -7ąDS

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Total time spent on category (Outlook98/WinNT4)

    Thanks, John, that looks like should do it. Only trouble is, when I said I know nothing about Outlook VBA, I meant it literally - <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15> I can't even find the VBE, let alone know how to set up and use a macro in Outlook! <img src=/S/blush.gif border=0 alt=blush width=15 height=15>
    Beryl M


  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Total time spent on category (Outlook98/WinNT4)

    I'm afraid there is no Visual Basic Editor in Outlook 98, or not much of one; the only coding you can do is behind Outlook forms. The Outlook Object model is meant for controlling Outlook from other applications, such as Word or VB6. Things get better in later versions of Outlook, although it's still very limited when compared to Word, Excel etc.

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Total time spent on category (Outlook98/WinNT4)

    Ah - does that mean I can't use John's code?

    At least for the moment - our upgrade to Office 2003 is looming closer ...
    Beryl M


  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Total time spent on category (Outlook98/WinNT4)

    If I remember correctly, there is no way to just create, edit or run a macro in Outlook 98 itself. You could, however, run the code from another application that has VBA, through Automation. That is, create an Outlook.Application object in code, and manipulate that.

    If I'm wrong, others will surely jump in.

  8. #8
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Total time spent on category (Outlook98/WinNT4)

    Ummm. I've seen that application.object business around before, but never tried to use it myself.

    I'll have to have a look into it ....

    Ta muchly.
    Beryl M


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

    Re: Total time spent on category (Outlook98/WinNT4)

    Beryl, completely my error for overlooking that you are on Outlook 98. Sorry! <img src=/S/grovel.gif border=0 alt=grovel width=31 height=23>
    -John ... I float in liquid gardens
    UTC -7ąDS

  10. #10
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Total time spent on category (Outlook98/WinNT4)

    's OK, John - I have a hard time believing we're still on Outlook 98 sometimes too! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Beryl M


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

    Re: Total time spent on category (Outlook98/WinNT4)

    For your first question, test this for a while by manually verifying that it's correct, including on a selection of appointments that totals more than 24 hours of time. (I don't have enough appointments at home!) Note that All Day Events are counted as zero time, though we could tweak this to count them as 8 hours or something if you wish. However in Outlook, because time zone changes and daylight savings time changes mess up some All day Events (including Holidays), some All Day events may have been reset to 24 hours duration. Select the Calendar items and Category manually then run the macro.

    Sub GetCalTimes()
    Dim dblTime As Double
    Dim intC As Integer
    For intC = 1 To ActiveExplorer.Selection.Count
    If ActiveExplorer.Selection(intC).Class = olAppointment Then _
    dblTime = dblTime + _
    ActiveExplorer.Selection(intC).End - ActiveExplorer.Selection(intC).Start
    Next intC
    MsgBox "Time on selected items (#h:mm:ss): " & _
    Int(dblTime * 24) & Format(dblTime, ":nn:ss")
    End Sub
    -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
  •