Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
Exchange Web Services .NET
>
Tutorial
> Add attendee
The following example shows you how to add attendee to an existing meeting.
C# example
using System; using System.Net; using Independentsoft.Exchange; namespace Sample { class Program { static void Main(string[] args) { NetworkCredential credential = new NetworkCredential("username", "password"); Service service = new Service("https://myserver/ews/Exchange.asmx", credential); try { Appointment appointment = service.GetAppointment("AAMkAAAAAAAAYAABClH/p3xPfSLGfvkhFmBB/AAvTWJunAAA="); ItemId itemId = appointment.ItemId; ItemChange itemChange = new ItemChange(itemId); itemChange.PropertiesToAppend.Add(new Property(AppointmentPropertyPath.RequiredAttendees, new Attendee("John@mydomain.com"))); itemId = service.UpdateItem(itemChange, SendMeetingOption.SendToChanged); } catch (ServiceRequestException ex) { Console.WriteLine("Error: " + ex.Message); Console.WriteLine("Error: " + ex.XmlMessage); Console.Read(); } catch (WebException ex) { Console.WriteLine("Error: " + ex.Message); Console.Read(); } } } }
VB example
Imports System Imports System.Net Imports Independentsoft.Exchange Namespace Sample Class Module1 Shared Sub Main(ByVal args As String()) Dim credential As New NetworkCredential("username", "password") Dim service As New Service("https://myserver/ews/Exchange.asmx", credential) Try Dim appointment As Appointment = service.GetAppointment("AAMkAAAAAAAAYAABClH/p3xPfSLGfvkhFmBB/AAvTWJunAAA=") Dim itemId As ItemId = appointment.ItemId Dim itemChange As ItemChange = New ItemChange(itemId) itemChange.PropertiesToAppend.Add(New [Property](AppointmentPropertyPath.RequiredAttendees, New Attendee("John@mydomain.com"))) itemId = service.UpdateItem(itemChange, SendMeetingOption.SendToChanged) Catch ex As ServiceRequestException Console.WriteLine("Error: " + ex.Message) Console.WriteLine("Error: " + ex.XmlMessage) Console.Read() Catch ex As WebException Console.WriteLine("Error: " + ex.Message) Console.Read() End Try End Sub End Class End Namespace
Need help? Ask our developers:
Name*
Email*
Message*