Automating the distribution of a company Outlook.hol file to all users.

Posted on 2006-04-26
Last Modified: 2007-12-19
We want to be able to use outlook.hol to post company events and holidays.  We can edit the file and make it available to all of our users, but my question is this:

Since this file will require periodic updates throughout the year, is there away we can automate the distribution and the subscription to the file?  Perhaps use a GPO to push out the file and/or do the Tools>Options>Calendar Options>Add Holidays>Click on the appropriate category and OK?

Question by:dmbonilla4
    LVL 76

    Accepted Solution

    Hi dmbonilla4,

    I'm not sure this is going to work the way you may be thinking.  Adding holidays to a calendar is a one-way process.  There is no synchorization or updating.  If you a Company Picnic on May 1st, and then it changes, each employee would have to remove the first entry and then add the second entry.  If you run a holiday file multiple times it adds multiple entries, it doesn't adjust the existing entries.


    Author Comment

    Thank you for the info BlueDevilFan (they disappointed me in the NCAA Tourney, as I'm sure you were too).  I understand the problem with changing a scheduled event but, if we add an event between two others, would the first two events be duplicated when the holiday file is run the second time? Thanks again.

    Author Comment

    Thank you again BDF.  I've got what I need.
    LVL 76

    Expert Comment

    by:David Lee
    You're welcome.  Yes, I was very disappointed.  To asnwer your question, yes, if you inserted event C between events A and B and ran the file again you'd end up with 1 C and 2 each A and B.  I was going to offer an alternative to using .hol files using a bit of VBScripting.  Let me know if you're interested in that.

    Author Comment

    I am always interested in alternatives.  Please educate me.  Thank you.
    LVL 76

    Expert Comment

    by:David Lee
    I wrote the script below to allow staff to add events like pay period starting and ending dates, company functions, etc. to their calendars.  The script reads a file containing one event per line in the form EVENT NAME:EVENT DATE.  The script could be modified to check for the existence of a given appointment and update it if it is found, or add it if it isn't.  The script and data file can be placed on a network share or a web site and employees sent a link.  All they have to do is click on the link.  When they do the script runs and modifies their calendar.

    Dim olkApp, olkCalendar, olkEvent, objFSO, objFile, arrItem, strFilename
    strFilename = WScript.Arguments(0)
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(strFilename)
    Set olkApp = CreateObject("Outlook.Application")
    Set olkCalendar = olkApp.GetNamespace("MAPI").GetDefaultFolder(9)
    Do While Not objFile.AtEndOfStream
        arrItem = Split(objFile.ReadLine, ":")
        Set olkEvent = olkApp.CreateItem(1)
        olkEvent.Subject = arrItem(0)
        olkEvent.Start = arrItem(1)
        olkEvent.AllDayEvent = True
        olkEvent.ReminderSet = False
    Set olkEvent = Nothing
    Set olkCalendar = Nothing
    Set olkApp = Nothing
    Set objFile = Nothing
    Set objFSO = Nothing
    WScript.Echo "Events Added"

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Learn more about the importance of email disclaimers with our top 10 email disclaimer DOs and DON’Ts.
    Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    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…

    759 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

    12 Experts available now in Live!

    Get 1:1 Help Now