Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-11-27
4
Medium Priority
?
2,587 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 2000 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

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

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

High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

927 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