Delete a Section in Word with NET REST API

This guide shows Java developers how to use the WordsApi class from the Aspose.Words Cloud SDK to remove a specific section from a DOCX document — the target format is detailed on the DOCX file information page. You will learn to select any section by its index and delete it via the Java REST API.

Prerequisite

Steps to Delete Section in Word with Java Low Code API

  1. Instantiate the WordsApi class with your client ID and client secret.
  2. Create a DeleteSectionOnlineRequest object and configure its parameters.
  3. Provide the source Word document and the index of the section you want to delete.
  4. Call the DeleteSectionOnline() method, passing the request object.
  5. Retrieve the resulting Word file from the response using Result.TryGetValue().
  6. Save the output Word file from the returned stream.

The steps above outline how to delete a section in Word using the Java REST API. Begin by creating a DeleteSectionOnlineRequest, set the source document and the target section index, then invoke DeleteSectionOnline() to perform the deletion.

Code to Remove Section in Word with Java REST API

The sample demonstrates how to remove a section in a Word document with the Java Low Code API. The response contains a key‑value pair where the resulting Word file is provided as a stream object; you can download it using Result.TryGetValue().

For information on adding a section break, see the related article: Add section break in Word with Java REST API.

Keywords: how to delete a section in word with Java REST API; how to remove a section in word with NET REST API; how to remove section in word with Java Low Code API; delete a section in word with NET REST API; ms word delete section with Java Low Code API.