CodersAdvocate

I work hard, so you don't have to

Making Microsoft Outlook (v11.0) Bookings Using VCalendar

 
Before I start this article you will need to used content disposition in your chosen language. That way you can print out a Calendar booking using php, asp, c# or even JAVA if you wanted to.

This has many uses on an intranet if you were to say book meetings with each other over a booking system.

Let's jump straight in...
The first thing you're going to need is the mime types for the calendar booking.
in VB the code would look something like this...
        Response.ContentType = "text/x-VCALENDAR" 'set mime types
        Response.AppendHeader("Content-Disposition", "attachment; filename=" + "booking.vcs" + ";") 'set the additional headers
        Response.Flush()
Notice: the mime type for the booking event (text/x-VCALENDAR) and the extension for the package you need to send down (*.vcs).

In essence that's how you set the headers for a content disposition, maybe that deserves its own article. Well anyway, onwards and upwards.


The following is the format of the event file:
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
VERSION:1.0
BEGIN:VEVENT
DTSTART:[*START DATE TIME*]
DTEND:[*END DATE TIME*]
LOCATION:[*LOCATION*]
DESCRIPTION:[*SYNOPSIS OF THE PURPOSE OF THE BOOKING(meeting)*]
SUMMARY;ENCODING=QUOTED-PRINTABLE:subject
PRIORITY:3
END:VEVENT
END:VCALENDAR
Each of these needs to be on a new line but experiment around. That's a basic vCalendar event, there are lots more cool things you can do (e.g auto assign bookies). For more information on vCalendar formats why not create a complete booking in outlook but not send it, instead save its vcs format and then open with notepad.
God only knows how many times I have used that hack when I create a bolt on.
Let me know how it goes.
Copyright 2011 CodersAdvocate ©