I am trying to use the Exchange 2007 API to request calendar availability for a specific user. In my sample code, the following exception is thrown:
The length of time specified for FreeBusyViewOptions.TimeWindow is not valid.
Here is an example code:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1); service.AutodiscoverUrl(" email@domain.com "); DateTime startTime = new DateTime(2012, 1, 6, 7, 0, 0); TimeWindow tw = new TimeWindow(startTime, startTime.AddHours(8)); GetUserAvailabilityResults result = service.GetUserAvailability(new List<AttendeeInfo> { new AttendeeInfo(" email@domain.com ") }, tw, AvailabilityData.FreeBusyAndSuggestions);
The strangest thing is if I replace the startTime destination with the following:
DateTime startTime = DateTime.Now;
What is the difference between the created DateTime object and the object created by DateTime.Now. I studied them in detail during debugging and did not find the difference.
Any ideas?
joshb source share