none
How to add schedule into the outlook using c# RRS feed

All replies

  • Hi AnkitKumar2016,

    According to your last thread in C# forum, I think what you want is to add an appointment, right?

    Here is some simply code in a Windows Form project, you could try to adjust it for your need.

           private void btnCreateAppointment_Click(object sender, EventArgs e)
            {
                //add reference to Microsoft.Office.Interop.Outlook
                //using Outlook = Microsoft.Office.Interop.Outlook;
    
                //create an outlook application
                Outlook.Application application = new Outlook.Application();
                //create a new appointment
                Outlook.AppointmentItem appointmentItem = application.CreateItem(Outlook.OlItemType.olAppointmentItem);
                //set content of the appointment
                appointmentItem.Subject = "This is an appointment for testing";
                appointmentItem.Body = "This is the content of the appointment";
                appointmentItem.Location = "This appointment will be hold in here";
                appointmentItem.Start = DateTime.Now;
                appointmentItem.End = DateTime.Now.AddMinutes(30);
                appointmentItem.Save();
            }

    Best Regards,

    Terry


    MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    Friday, November 24, 2017 8:46 AM
  • Hello,

                  I created one appointment now i want to delete this appointment by the c# code.

    Actually i want to know how to delete appointment  (by id or particular date).  does this possible?

    thanks

    Friday, November 24, 2017 10:17 AM
  • Hello,

    Thank you for posting in the MSDN Forum.

    Since your original issue has been resolved, I would suggest you mark helpful answer to close this thread and post a new thread for the new issue. Thanks for understanding.

    Best Regards,

    Terry


    MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    Monday, November 27, 2017 3:21 AM