Solved

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

Posted on 2010-11-27
4
2,436 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
Find out what you should include to make the best professional email signature for your organization.
In this video we show how to create a mailbox database 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 >> Data…
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…

831 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