Filter Outlook appointments by category
问题 I have written this code to find the total duration of all appointments of a specified category within a specified time range: private readonly MAPIFolder _timing; private int CalculateTotalDuration(DateTime start, DateTime end, string category) { string filter = String.Format( "([Start] >= '{0:g}') AND ([End] <= '{1:g}') AND ([Categories] = '{2}')", start, end, category); return _timing.Items.Restrict(filter).Cast<AppointmentItem>(). Sum(appt => appt.Duration); } This code results in the