4

I am using the DDal ical library which works great but i just realized that i wanted to see how to indicate an event as out of office versus busy (so it shows up different when loaded in microsoft outlook

I see the property listed on this microsoft site called:

  • X-MICROSOFT-CDO-BUSYSTATUS
  • PidLidBusyStatus

Is this possible to set this from within DDay ical library as i don't see anything in the documentation?

leora
  • 188,729
  • 360
  • 878
  • 1,366

2 Answers2

4

If you have Free/Busy Component on your mind described in RFC 2445, then it is not implemented yet based on the DDay.iCal Compliance with RFC 2445 list.

Ondrej Janacek
  • 12,486
  • 14
  • 59
  • 93
  • is this what indicate as out of office versus busy? – leora Nov 16 '13 at 10:11
  • I went throught all the code and unless the functionality you seek is named so that it hides in something else (which I don't think so), than yes ... should you come across a different statement, do tell me, please – Ondrej Janacek Nov 16 '13 at 10:15
1

(Don't use dday.ical; use ical.net. It contains many performance enhancements and bugfixes.)

Anything prefixed with X- means it's vendor-specific. There is no standard way to say "out of office" vs "busy". I believe Outlook also has a notion of "tentative" that also goes into that field.

The icalendar spec supports four basic statuses: "FREE", "BUSY", "BUSY-UNAVAILABLE", "BUSY-TENTATIVE". These are all valid options for the VFREEBUSY component. The spec intends for the VFREEBUSY with its subheading FREEBUSY components to essentially communicate free-busy information for people trying to plan a meeting. Outlook has its scheduling assistant feature; it may will be using VFREEBUSY information to show its timelines.

So that's not really what you're looking for.

The spec does have a notion of categories, and one of the examples is "NOT IN OFFICE":

Some possible English values for "CATEGORIES" property include: "ANNIVERSARY", "APPOINTMENT", "BUSINESS", "EDUCATION", "HOLIDAY", "MEETING", "MISCELLANEOUS", "NON-WORKING HOURS", "NOT IN OFFICE", "PERSONAL", "PHONE CALL", "SICK DAY", "SPECIAL OCCASION", "TRAVEL", "VACATION". Categories can be specified in any registered language.

Neither of these options is great, and is, IMO, yet another place the spec falls short. You almost want a BUSY-OUT-OF-OFFICE status that can be specified in a VFREEBUSY manifest, but the spec doesn't have it, and neither does ical.net (or dday.ical before it).

To that end, you're better off adding the X-MICROSOFT-CDO-BUSYSTATUS property to the event manually, if Outlook is the thing consuming the serialized output:

var now = DateTime.Now;
var later = now.AddHours(1);

var e = new Event
{
    DtStart = new CalDateTime(now),
    DtEnd = new CalDateTime(later),
};
e.AddProperty("X-MICROSOFT-CDO-BUSYSTATUS", "OOF"); // I think "OOF" is right per the MS documentation

var calendar = new Calendar();
calendar.Events.Add(e);

var serializer = new CalendarSerializer(new SerializationContext());
var icalString = serializer.SerializeToString(calendar);
Console.WriteLine(icalString);

That'll generate this:

BEGIN:VCALENDAR
PRODID:-//github.com/rianjs/ical.net//NONSGML ical.net 2.1//EN
VERSION:2.0
BEGIN:VEVENT
DTEND:20160827T162931
DTSTAMP:20160827T192931Z
DTSTART:20160827T152931
SEQUENCE:0
UID:fea526df-7f40-4585-a9de-8d422e43eebe
X-MICROSOFT-CDO-BUSYSTATUS:OOF
END:VEVENT
END:VCALENDAR
Community
  • 1
  • 1
rianjs
  • 7,767
  • 5
  • 24
  • 40