title: EWS Create Appointment in exchange with extra custom properties
body: <p>Im currently looking at a way to save a few extra properties to an exchange appointment using C#. Currently I can save using the following properties:</p>
  
  <pre><code>Appointment calendar = new Appointment(p_service);
  
  calendar.Subject = calendarS5Subject;
  calendar.Body = calendarS5Body;
  calendar.Start = calendarS5StartDateTime;
  calendar.End = calendarS5EndDateTime;
  calendar.IsReminderSet = false;
  calendar.Location = calendarS5Location;
  calendar.Body.BodyType = BodyType.Text;
  
  calendar.Save();
  </code></pre>
  
  <p>However I want to be able to store my own custom properties like <code>calendar.EventID</code> and <code>calendar.Blah</code> . Is it possible to save these properties against the appointment and then be able to access them later? It would be even better if it could all be stored as a user control form inside the appoint window. I know you can do this with an outlook addin that uses the type <strong>AppointmentItem</strong>. However I am yet to find a way to do it with exchange with the type of <strong>Appointment</strong>. </p>
  
  <p>TIA.</p>
  
  <p>I have now been able to save the extra property using:</p>
  
  <pre><code>Guid EventIDSetGUID = new Guid("{C11FF724-AA03-4555-9952-8FA248A11C3E}");
  ExtendedPropertyDefinition extendedPropertyEventID = new ExtendedPropertyDefinition(EventIDSetGUID, "EventID", MapiPropertyType.String);
  calendar.SetExtendedProperty(extendedPropertyEventID, calendarS5EventID);
  </code></pre>
  
  <p>However I am now struggling to read back that property later on. This work right after I have saved the extra property but if I restart the application and then try to read the extra property <code>eventIDProp</code> always returns <code>null</code>. My code for reading:</p>
  
  <pre><code>Guid EventIDReadGUID = new Guid("{C11FF724-AA03-4555-9952-8FA248A11C3E}");
  ExtendedPropertyDefinition extendedPropertyEventIDRead = new ExtendedPropertyDefinition(EventIDReadGUID, "EventID", MapiPropertyType.String);
  object eventIDProp;
  if (calendar.TryGetProperty(extendedPropertyEventIDRead, out eventIDProp) &amp;&amp; eventIDProp != calendarS5EventID)
  {
  
  }
  </code></pre>