private void AddAppointment()
{
try
{
Microsoft.Office.Interop.Outlook.Application otApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.AppointmentItem oAppointment = (Microsoft.Office.Interop.Outlook.AppointmentItem)otApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);
oAppointment.Subject = "[FSRAMS] Laptop Loan Due for return.";
oAppointment.Body = "Please contact customer to return their loan device.";
oAppointment.Start = Convert.ToDateTime(DateTime.Now.AddHours(1));
oAppointment.End = Convert.ToDateTime(DateTime.Now.AddDays(1));
oAppointment.ReminderSet = true;
oAppointment.ReminderMinutesBeforeStart = 15;
oAppointment.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh;
oAppointment.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy;
oAppointment.Save();
}
catch (Exception ex)
{
MessageBox.Show("The following error occurred: " + ex.Message);
}