In this tutorial you’ll discover how to create a table in Word with the .NET REST API. Using Aspose.Words for .NET Cloud SDK, we’ll show you how to insert a table in a Word document via the C# Low‑Code API, invoke the required API calls, and save the resulting file locally. The guide walks you through every step needed to configure the environment and build the application on any platform that supports the SDK.
Prerequisite
- Create an account and get API credentials
- Download Aspose.Words Cloud SDK for Dotnet to add a bookmark in a Word file
- Setup C# solution project with the above SDK
Steps to Create a Table in Word Document with C# REST API
- Create the WordsApi class object using the client ID and secret
- Read the input Word file into a memory stream
- Create the TableInsert object and set the rows and columns count
- Create the InsertTableOnlineRequest using the input document, requested table and output file
- Call InsertTableOnline to create a table using the table request above
- 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 example demonstrates how to create a table in MS Word using the C# REST API. By calling the InsertTableOnline method, the table is appended to the end of the Word document and the updated file is saved in the cloud under the specified destination filename. Simply use the task’s result to download the modified document to your local machine.
In this article we’ve demonstrated how to insert a table in a Word document with the C# Low‑Code API. When you’re ready to combine multiple files, check out our step‑by‑step guide: Merge Word Documents with NET REST API.