Delete a Section in Word with NET REST API

This article describes the process to delete a section in Word with NET REST API. You will learn how to remove a section in Word with NET REST API using the .NET cloud SDK. It provides the option to select any section in the target document using its index.

Prerequisite

Steps to Delete Section in Word with C# Low Code API

  1. instantiate the WordsApi class object to delete a section using the Client ID and secret
  2. Instantiate an object of the DeleteSectionOnlineRequest class to set the parameters
  3. Set the source Word document and index of the section you want to delete
  4. Invoke the DeleteSectionOnline() method using the above request object
  5. Access the resultant Word file using the Result.TryGetValue() method
  6. Save the output Word file from the stream in the response

The above steps describe how to delete a section in Word with C# REST API. To commence the process, create an object of the DeleteSectionOnlineRequest class, set its parameters such as source document and index of the target section you want to delete, and invoke the DeleteSectionOnline() method with the custom request to delete the section.

Code to Remove Section in Word with C# REST API

This sample code exhibits how to remove section in Word with C# Low Code API. The response contains a key-value pair containing the resultant World file in a stream object. You can download this file using the Result.TryGetValue() method from the list of values in the response.

In this topic, we have learned the process of deleting a section. If you are looking to add a section break, refer to the following article: Add section break in Word with NET REST API.

 English