Question : Automated countdown in outlook calendar?

Experts,
I've finally set my last day in my current job (congratulations to me!), and I want to put a daily countdown in my Outlook Calendar (Office Prof. Ed. 2003 - 11.5608.5606). Ideally I would get a "XX work days left!" when I open outlook each morning. Work days vs. regular days not terribly important.

Clearly I can do this manually, but some sort of automation would be great! TIA!

Answer : Automated countdown in outlook calendar?

Here's the code for doing this.  Follow these intstructions to use it.

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Modules and click on Module1
4.  Copy the code below and paste it into the right-hand pane of the VB Editor
5.  Edit the code as needed.  I placed a comment before each line that needs to be edited
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Click Tools->Macro->Security
9.  Change the Security Level setting to Medium
10.  Run the macro.  Don't run it more than once or you'll end up with duplicate events.


Sub Countdown()
    Dim olkEvent As Outlook.AppointmentItem, _
        datDeparture As Date, _
        intDaysToGo As Integer, _
        intCounter As Integer
    'Enter your departure date on the following line
    datDeparture = #5/1/2006#
    intDaysToGo = DateDiff("d", Date, datDeparture)
    For intCounter = intDaysToGo To 0 Step -1
        Set olkEvent = Application.CreateItem(olAppointmentItem)
        With olkEvent
            'Edit the event subject ont he following line
            .Subject = IIf(intCounter = 0, "Last Day", intCounter & IIf(intCounter = 1, " day ", " days ") & "till I depart")
            .Start = datDeparture - intCounter
            .AllDayEvent = True
            .ReminderSet = False
            .Save
        End With
    Next
    Set olkEvent = Nothing
End Sub
Random Solutions  
 
programming4us programming4us