Welcome to Office 365 APIs | Microsoft Docs
Skip to main content

Office 365 APIs

This site contains the documentation for Office 365 REST APIs exposed on the OneNote and Outlook endpoints. The documentation is no longer actively updated. It is here for your reference, in case you have already included any of the API in your project.

Office 365 services, such as OneNote, Outlook, Excel, OneDrive, Microsoft Teams, Planner, and SharePoint, are now exposed in Microsoft Graph. Microsoft Graph is a unified API endpoint for accessing data across Microsoft 365, which includes Office 365, Enterprise Mobility, and Security and Windows services. It provides a simplified developer experience, with one endpoint and a single authentication token that gives your app access to data across all these services.

Our recommendation:

  • If you are starting a new app, please use Microsoft Graph.
  • If you are maintaining an existing project, use this documentation set for reference. In addition, plan your move to the latest APIs in Microsoft Graph to take advantage of all the new functionality and innovation there.
  • If you are adding new functionality to an existing project, integrate that new functionality by using Microsoft Graph.

With Microsoft Graph, you can access Office 365 data and more, from solutions across mobile, web, and desktop platforms. So whether you're building web applications by using .NET, PHP, Java, Python, or Ruby on Rails, or creating apps for the Universal Windows Platform (UWP), iOS, Android, or on another device platform, it's your choice.

In this section

 none
Who can help me to write code about delete appointment from where I create appointment about outlook please help me RRS feed

  • Question

  • I am using c# wpf I need  code that Delete  appointment  from outlook please help me
    • Moved by 宝宝徐 Tuesday, November 7, 2017 5:45 AM
    • Moved by Bob Ding Tuesday, November 7, 2017 6:07 AM move to outlook forum
    Monday, November 6, 2017 1:39 PM

All replies

  • Hi,

    Welcome to MSDN forum.

    I will move your thread to outlook for developer for professional support, if you have problems about visual studio IDE, please feel free to let me know.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" 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 MSDNFSF@microsoft.com.

    • Edited by Bob Ding Tuesday, November 7, 2017 6:05 AM move to outlook for developer forum
    Tuesday, November 7, 2017 5:43 AM
  • Do you have any code that using c# WPF and remove appointment from outlook

     
    Tuesday, November 7, 2017 6:21 AM
  • Hi aaydinalp,

    You could use Microsoft Interop Outlook API to do this work. You need get the outlook application instance and then the calendar folder. You could iterate through the folder to look for the appointment you want to delete and then delete it.

    Here is the simply code I used to delete an appointment which subject is "TestAppointment". You could try to adjust it for your need.

      private void Button_Click(object sender, RoutedEventArgs e)
            {
                //remember to add reference to Microsoft.office.interop.Outlook
                //and using Outlook = Microsoft.Office.Interop.Outlook;
                Outlook.Application olApp;
                try {
                    //get current opened outlook application instance
                    olApp = (Outlook.Application)Marshal.GetActiveObject("Outlook.Application");
                }
                catch{
                    //create a new outlook application instance
                    olApp = new Outlook.Application();
                }
                //get the default calendar folder
                Outlook.MAPIFolder folder = olApp.GetNamespace("MAPI").GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
                Outlook.AppointmentItem appointmentItem;
                //iterate through items in the calendar folder
                for (int i = 1; i <= folder.Items.Count; i++) {
                    if (folder.Items[i] is Outlook.AppointmentItem) {
                        appointmentItem = (Outlook.AppointmentItem)folder.Items[i];
                        //if the item is appointment and its subject is "TestAppointment" then delete it
                        if (appointmentItem.Subject == "TestAppointment") {
                            appointmentItem.Delete();
                        }
                    }
                }
            }

    Here is the demonstration.

    You could refer to below link for more information.

    How to: Programmatically Delete Appointments

    Best Regards,

    Terry


    MSDN Community Support Please remember to click &amp;quot;Mark as Answer&amp;quot; the responses that resolved your issue, and to click &amp;quot;Unmark as Answer&amp;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 MSDNFSF@microsoft.com.


    Tuesday, November 7, 2017 9:55 AM
  • thank you  how can I find  delete   items name with date and time

     because I cannot find date and time from  your code  

                





    • Edited by aaydinalp Tuesday, November 7, 2017 11:47 AM
    Tuesday, November 7, 2017 11:30 AM
  • Hello,

    You need to find the appointment at the specified time slot first. For that you can use the Find/FindNext or Restrict methods of the Items class. Read more about these methods in the following articles:

    How To: Retrieve Outlook calendar items using Find and FindNext methods

    How To: Use Restrict method in Outlook to get calendar items

    And also you may find helpful:

    How To: Create a new Outlook Appointment item

    How To: Create a new recurring Outlook Appointment item


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    • Proposed as answer by Terry Xu - MSFT Wednesday, November 8, 2017 1:00 AM
    Tuesday, November 7, 2017 6:04 PM
Welcome to Office 365 APIs | Microsoft Docs
Skip to main content

Office 365 APIs

This site contains the documentation for Office 365 REST APIs exposed on the OneNote and Outlook endpoints. The documentation is no longer actively updated. It is here for your reference, in case you have already included any of the API in your project.

Office 365 services, such as OneNote, Outlook, Excel, OneDrive, Microsoft Teams, Planner, and SharePoint, are now exposed in Microsoft Graph. Microsoft Graph is a unified API endpoint for accessing data across Microsoft 365, which includes Office 365, Enterprise Mobility, and Security and Windows services. It provides a simplified developer experience, with one endpoint and a single authentication token that gives your app access to data across all these services.

Our recommendation:

  • If you are starting a new app, please use Microsoft Graph.
  • If you are maintaining an existing project, use this documentation set for reference. In addition, plan your move to the latest APIs in Microsoft Graph to take advantage of all the new functionality and innovation there.
  • If you are adding new functionality to an existing project, integrate that new functionality by using Microsoft Graph.

With Microsoft Graph, you can access Office 365 data and more, from solutions across mobile, web, and desktop platforms. So whether you're building web applications by using .NET, PHP, Java, Python, or Ruby on Rails, or creating apps for the Universal Windows Platform (UWP), iOS, Android, or on another device platform, it's your choice.

In this section