How to delete slides from a PowerPoint PPTX presentation document in C# .NET Framework
1 min readFeb 22, 2020
Today I’m going to show you how to save hours of programming and implement slide deletion functionality in just a few minutes, using one of our handy APIs.
Obviously the first thing we must do is install our API. This can be done by simply running this command in Package Manager.
Install-Package Cloudmersive.APIClient.NET.DocumentAndDataConvert -Version 2.2.0
With our API client installed, we can now access EditDocumentPptxDeleteSlides:
using System;using System.Diagnostics;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Api;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Client;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Model;namespace Example{public class EditDocumentPptxDeleteSlidesExample{public void main(){// Configure API key authorization: ApikeyConfiguration.Default.AddApiKey("Apikey", "YOUR_API_KEY");// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed// Configuration.Default.AddApiKeyPrefix("Apikey", "Bearer");var apiInstance = new EditDocumentApi();var reqConfig = new RemovePptxSlidesRequest(); // RemovePptxSlidesRequest | Presentation input requesttry{// Delete, remove slides from a PowerPoint PPTX presentation documentbyte[] result = apiInstance.EditDocumentPptxDeleteSlides(reqConfig);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling EditDocumentApi.EditDocumentPptxDeleteSlides: " + e.Message );}}}}
Done! So easy. Before you go off to celebrate this sudden spate of free time, you may wish to look at our other APIs, and maybe save yourself even more work.