Automated countdown in outlook calendar?

Posted on 2006-04-24
Last Modified: 2008-02-01
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!
Question by:goldband
    LVL 76

    Expert Comment

    by:David Lee
    Hi goldband,

    do you want it to appear as an event at the top of the daily calendar?


    Author Comment

    That would be perfect!
    LVL 76

    Accepted Solution

    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
            End With
        Set olkEvent = Nothing
    End Sub

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
    Outlook Free & Paid Tools
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now