Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 22nd, 2012  |  syntax: None  |  size: 0.97 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Get Appointment ID after sending an Appointment
  2. Microsoft.Office.Interop.Outlook.Application app = null;
  3. Microsoft.Office.Interop.Outlook.AppointmentItem appt = null;
  4.  
  5. app = new Microsoft.Office.Interop.Outlook.Application();
  6.  
  7. appt = (Microsoft.Office.Interop.Outlook.AppointmentItem)app
  8.     .CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);
  9. appt.Subject = "Meeting ";
  10. appt.Body = "Test Appointment body";
  11. appt.Location = "TBD";
  12. appt.Start = Convert.ToDateTime("06/01/2012 05:00:00 PM");
  13. appt.Recipients.Add("sanjay.surendra@mycompany.com");
  14. appt.End = Convert.ToDateTime("06/01/2012 6:00:00 PM");
  15. appt.ReminderSet = true;
  16. appt.ReminderMinutesBeforeStart = 15;
  17. appt.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh;
  18. appt.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy;
  19. appt.Save();
  20. Microsoft.Office.Interop.Outlook.MailItem mailItem = appt.ForwardAsVcal();
  21. mailItem.To = "sanjay.surendra@mycompany.com";
  22. mailItem.Send();