Set Paragraph Formatting in Word with NET REST API

This guide explains how to set paragraph formatting in Word with NET REST API. You will learn to update the format of writing paragraph with C# Low Code API using the .NET cloud SDK. Full control is available to work with the Word document for changing contents and formatting.

Prerequisite

Steps to Change Paragraph Writing Format with C# REST API

  1. Initialize the WordsApi object by providing the client ID and secret to set paragraph formatting
  2. Read the source Word file into the byte array for changing the paragraph formatting
  3. Instantiate the ParagraphFormatUpdate object and set the formatting parameters
  4. Create the UpdateParagraphFormatOnlineRequest object using the above settings
  5. Call the UpdateParagraphFormatOnline method using the request object
  6. Save the output Word file after changing the formatting style

The above steps define how to change Microsoft Word paragraph formatting with C# REST API. Load the source Word file and create the ParagraphFormatUpdate object by providing the custom settings for changing the format. Call the UpdateParagraphFormatOnline() method to apply the changes and save the output file.

Code to Change Paragraph Formatting with C# Low Code API

This sample code exhibits the alignment, styling, and indenting paragraphs with C# REST API. You can set the link, alignment, drop cap position, first-line indentation, line spacing, page breaks, and style names. You can select the target paragraph using the index parameter in the constructor of the UpdateParagraphFormatOnlineRequest class or set the Index attribute of its object.

In this topic, we have learned the MS Word paragraph formatting with C# Low Code API. To replace a text in a Word file, refer to the following article: Replace a word in Word with NET REST API.

 English