Solved

C# create calendar item with EWS, how to get back the reslust?

Posted on 2010-11-27
4
2,402 Views
Last Modified: 2013-12-17
Hello, I build an app based on this site http://msdn.microsoft.com/en-us/library/dd633661%28v=EXCHG.80%29.aspx

appointment.Subject = "Status Meeting";
appointment.Body = "The purpose of this meeting is to discuss status.";
appointment.Start = new DateTime(2009, 3, 1, 9, 0, 0);
appointment.End = appointment.Start.AddHours(2);
appointment.Location = "Conf Room";
appointment.RequiredAttendees.Add("user1@contoso.com");
appointment.RequiredAttendees.Add("user2@contoso.com");
appointment.OptionalAttendees.Add("user3@contoso.com");
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);

Open in new window


how I can return the XML results "... < t:ItemId Id="AAMkADk=" ChangeKey="DwAAAB" /> ..." so I can use it later to delete or edit the calendar item!?!

Microsoft made a god job with the whole Framework, but did they really forgot this little thing?

I found some (not logical for me) solution http://blogs.msdn.com/b/exchangedev/archive/2010/02/25/determining-the-id-of-a-sent-message-by-using-extended-properties-with-the-ews-managed-api.aspx should I use this to solve the issue?

cheers
0
Comment
Question by:Data-Base
  • 2
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
Robberbaron (robr) earned 500 total points
ID: 34229217
the Appointment object has an Id property.  this is the itemId from XML.

http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.appointment_members(EXCHG.80).aspx
 ....  Id   Gets the ID of this item. (inherited from Item)
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);
//now can get the EWS id of the item.
string apptId = appointment.Id.UniqueId;

Open in new window

0
 

Author Comment

by:Data-Base
ID: 34229347
what about the "ChangeKey", do I need it for something else? why it is there?

Thanks by the way, I will test now :-)
0
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 34245849
ChangeKey does not appear to be part of the API.

I believe it is usually used with synchronization. ie tell if an item has been changed.   using SyncFolderItems on a folder is probably easier but not as granular
0
 

Author Closing Comment

by:Data-Base
ID: 34275396
Thanks allot :-)
0

Featured Post

Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

Resolve DNS query failed errors for Exchange
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now