...

View Full Version : Add Event to Outlook



keith1995
08-14-2007, 04:45 PM
We have a calendar created via PHP and MySQL. Upon clicking on an event and viewing the full details of the event, we'd like to add a link that would download that event to Microsoft Outlook. The data for the download would come from the database which we'd Query via the unique ID for the event.

Any ideas what format or how we'd go about creating the necessary PHP code to call the database, gather the event details, put them into the necessary format to work with Outlook and export the data to a file format that Outlook would automatically open?

Fumigator
08-14-2007, 08:07 PM
After reading your question I too was curious about this process, so I Googled +outlook +import +event and found this:

http://office.microsoft.com/en-us/outlook/HA011235831033.aspx?pid=CL100626971033

Which describes the format of a vCalendar-type file (extension .vcs). However I was not able to find a way to automatically import a vcs file into Outlook-- it seems the only way to do it is open Outlook and use the "import" utility inside the application. Perhaps there is a way to automate it, but I was not able to find it.

keith1995
08-14-2007, 08:14 PM
Fumigator,

Thanks for the response. I don't know much about the VCS format. I have seen the export to outlook calendar on a few different sites and they use the ICS format each time.

For example, look at:

http://www.wnymusic.com/calendar/?action=showevent&event_id=11672

They have an icon of a calendar next to the title of the event which is a link to a file called event_ics.php that generates the ICS file. I've contacted this website to see if they'd be willing to share their code but if anyone else has any ideas of how to do this, I'd be greatful.

A few other examples are:

http://www.caringonline.org/mc/community/eventdetails.do?eventId=108516
https://www.ischool.washington.edu/events/calendar.aspx?id=80
http://www.networkinphilly.com/

These sites don't use PHP to do the outlook link so I'm not sure how relevent they are.

Fumigator
08-14-2007, 09:18 PM
Looks like ics is = to vcs pretty much. Here's the file on the WNYMusic site:


BEGIN:VCALENDAR
VERSION:1.0
PRODID:Wnymusic.com Web Calendar
TZ:-05
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
SUMMARY:The Revenue
LOCATION:Club Infinity
URL;VALUE=URI:http://www.wnymusic.com/calendar.php?event_id=11672
DESCRIPTION;ENCODING=QUOTED-PRINTABLE: Tickets available at Club Infinity Box Office (716)565-0110, Tickets.com, Tops Supermarkets. Free Parking. All shows are 18 and up (if under 18, must be accompanied by someone over 21).
DTSTART:20070814T070000
DTEND:20070814T090000
END:VEVENT
END:VCALENDAR


Seems to me you can create a file in this format (fopen, fwrite), stick an ics extension on it, and there you go.

whizard
08-15-2007, 12:08 AM
http://filext.com/file-extension/ICS
http://filext.com/file-extension/vcs

HTH
Dan

(yay 1000th post!!!)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum