’ve been working on some vCard/vCalendar export code at work for the past couple of days, the main purpose being to import the resulting vCard/vCalendar files into Outlook. The problem being that Outlook doesn’t have any decent support for the vCalendar spec.
First gripe: The vCalendar spec outlines 2 types of “calendar entities”: vEvent and vTodo. vEvent support is so-so and Outlook doesn’t support vTodo at all. :(
Gripe the 2nd: A vCalendar file is pretty much an envelope around vEvents.
I mentioned in my last post that I was working on some vCard code. I figured I would post it here in case anybody is ever looking for a vCard implementation in C#. This code generates a valid vCard, supports multiple addresses and multiple phone numbers. It does not even come close to implementing the entire spec. Since my target system was Outlook, I saw no need to implement anything more than Outlook could support.
Here is a class that outputs a valid vCalendar string. Again, not all of the spec is implemented here since I was targeting Outlook. Everything that is here is all that Outlook supports (according to my findings)
Hope it comes in handy: using System; using System.Text; using System.IO; using System.Collections; namespace TT.Utility { /// <summary> /// Summary description for vEvent. /// </summary> public class VEvent { private DateTime _dateCreated = DateTime.