Search code examples
c#exchangewebservices

Bind meeting room to meeting EWS


Is there a way to bind a meeting room when creating a meeting with EWS ?

Right now I am creating the meeting like this :

var appointment = new Appointment(service)
{
    Subject = "Status Meeting",
    Body = "The purpose of this meeting is to discuss status.",
    Start = DateTime.Now.AddDays(2),
    End = DateTime.Now.AddDays(2).AddHours(2),
    RequiredAttendees = { "test@test.com" }
};
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);

But I cannot make it to bind to a specific room (Ex: myRoom@myOrg.onmicrosoft.com).

Thank you


Solution

  • You need to add the meeting room as a resource.

    Add the code below just before your appointment.Save code.

    appointment.Resources.Add("myRoom@myOrg.onmicrosoft.com");