none
[E2010] [EWSMA] [VB.NET]: Not returning All Day Calendat events if other events present. RRS feed

  • Question

  • I am using EWS Managed API 1.1 (v.14.2.51.0) to access Exchange 2010 (SP1) Calendar information.
    I am using Visual Studio 2008 to update our ASP.Net intranet web site.
    The plan is to have a page that our Reception can use to see where everyone is today, all on one page.

    The code (below) returns All Day calendar events if that is the only event for the day.
    It also returns a list of events that have start times but that are not All Day events.
    But if there is an All Day event (say 'at head office') and also another timed event (say 'meeting 11:00 am) the code will only retrieve the meeting event. The All Day event just disappears. Can I fix this?

    Dim exch As Object
    exch = exchserv(employee)

    Dim iv As ItemView = New ItemView(999)
    iv.Traversal = ItemTraversal.Shallow

    Dim filters As SearchFilter.SearchFilterCollection = New SearchFilter.SearchFilterCollection(LogicalOperator.And)
    filters.Add(New SearchFilter.IsLessThan(AppointmentSchema.Start, Dt.AddDays(+1)))
    filters.Add(New SearchFilter.IsGreaterThanOrEqualTo(AppointmentSchema.Start, Dt))

    Dim findResults As FindItemsResults(Of Item) = exch.FindItems(WellKnownFolderName.Calendar, filters, iv)
    Tuesday, November 22, 2011 3:44 PM