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
- Create an account and get API credentials
- Download Aspose.Words Cloud SDK for Dotnet to delete a section in a Word file
- Setup C# solution project with the above SDK for removing a section
Steps to Delete Section in Word with C# Low Code API
- instantiate the WordsApi class object to delete a section using the Client ID and secret
- Instantiate an object of the DeleteSectionOnlineRequest class to set the parameters
- Set the source Word document and index of the section you want to delete
- Invoke the DeleteSectionOnline() method using the above request object
- Access the resultant Word file using the Result.TryGetValue() method
- 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.