Create Appointment

The Create Appointment demo application demonstrates how to create an Appointment using EWS.

Example code:


  EWSSession.Active := True;
  try
    NewAppt := EWSSession.CreateMessage(dfinCalendar) as IRwEWSCalendarItem;

    NewAppt.Subject := edtSubject.Text;
    NewAppt.Location := EdtLocation.Text;

    NewAppt.IsAllDayEvent := chBxAllDayEvent.Checked;
    NewAppt.StartDateTime := RwLocalToUTC(Trunc(dtPckStartDate.Date)+dtPckStartTime.Time);
    NewAppt.EndDateTime := RwLocalToUTC(Trunc(dtPckEndDate.Date)+dtPckEndTime.Time);

    NewAppt.ReminderMinutesBeforeStart := udReminderMins.Position;
    NewAppt.ReminderIsSet := chBxReminder.Checked;
    NewAppt.LegacyFreeBusyStatus := TLegacyFreeBusy(cbBxBusyStatus.ItemIndex);
    NewAppt.BodyText := memoBody.Text;
    NewAppt.IsPrivate := chBxPrivate.Checked;

    NewAppt.SaveChanges;
  finally
    EWSSession.Active := False;
  end;

Screenshot:


Back to Examples