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
- Create an account and get API credentials
- Download Aspose.Words Cloud SDK for Dotnet to set paragraph formatting in a Word file
- Setup C# solution project with the above SDK for changing paragraph alignment, indentation, etc.
Steps to Change Paragraph Writing Format with C# REST API
- Initialize the WordsApi object by providing the client ID and secret to set paragraph formatting
- Read the source Word file into the byte array for changing the paragraph formatting
- Instantiate the ParagraphFormatUpdate object and set the formatting parameters
- Create the UpdateParagraphFormatOnlineRequest object using the above settings
- Call the UpdateParagraphFormatOnline method using the request object
- 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.