Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-11-27
4
Medium Priority
?
2,554 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
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 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‚Ķ
Suggested Courses

704 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