Filter Appointments from Exchange Server
Contents
[
Hide
]
Filtering Appointments with EWS
The IEWSClient provides the facility to filter appointments from the Exchange server using the ExchangeQueryBuilder. Appointments can be filtered based on:
- Dates
- Recurrences
Filtering Appointments by Dates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-.NET | |
IEWSClient client = EWSClient.GetEWSClient(mailboxUri, username, password, domain); | |
DateTime startTime = new DateTime(2017,09, 15); | |
DateTime endTime = new DateTime(2017, 10, 10); | |
ExchangeQueryBuilder builder = new ExchangeQueryBuilder(); | |
builder.Appointment.Start.Since(startTime); | |
builder.Appointment.End.BeforeOrEqual(endTime); | |
MailQuery query = builder.GetQuery(); | |
Appointment[] appointments = client.ListAppointments(query); |
Filtering Appointments by Recurring Events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-.NET | |
builder = new ExchangeQueryBuilder(); | |
builder.Appointment.IsRecurring.Equals(false); | |
query = builder.GetQuery(); | |
appointments = client.ListAppointments(query); |