Create Table in Word with NET REST API

This article entails the process to create table in Word with NET REST API. You will use Aspose.Words for .NET cloud SDK to insert table in Word with C# Low Code API by invoking the API calls and saving the output on the local system. All the necessary steps will be introduced to set the environment and develop the application on any platform supporting the SDK.

Prerequisite

Steps to Create a Table in Word Document with C# REST API

  1. Create the WordsApi class object using the client ID and secret
  2. Read the input Word file into a memory stream
  3. Create the TableInsert object and set the rows and columns count
  4. Create the InsertTableOnlineRequest using the input document, requested table and output file
  5. Call InsertTableOnline to create a table using the table request above
  6. Retrieve the API call result and save it in the local file

The aforementioned steps describe the process of making tables in Word with NET REST API. Commence the process by reading the input file and creating the request for adding a table to a Word file using the InsertTableOnlineRequest class. Once the request is generated, the InsertTableOnline method is called to insert a table with the destination file name provided as an argument.

Code to Create Table in Word Document with C# Low Code API

This sample code exhibits how to create a table in MS Word with C# REST API. When you use the InsertTableOnline method, it creates the table at the end of the Word file and saves the modified file in the cloud with the name specified as the destination file. You need to use the result of this task to download the modified file to the local system.

In this topic, we have learned how to insert table in a Word document with C# Low Code API. To merge documents, refer to the following article: Merge Word Documents with NET REST API.

 English