Easily open DOCX documents with just a few lines of C# code. Our .NET library will provide you with everything you need to access DOCX document content programmatically.
The task of reading DOCX documents is the task of reading hierarchical data structures within the DOM model. This implies knowing the format of each individual DOCX data element, including all of its possible child elements and attributes.
Our C# library is a cloud-based solution that will allow you to open DOCX files for reading and writing easily. This distributed approach gives you flexibility in software development using C# language, as all resource-intensive DOCX document processing will take place on Aspose servers. All you need is to get private keys to access Cloud API in C# code.
You can iterate over all elements of a DOCX document or you can search for specific elements in a DOM tree. We provide a wide range of C# functions both for working with the structure of the DOCX file and with the data contained in the document nodes.
The following code example will help you quickly figure out how to load a DOCX file using C# and perform some actions on it.
using Aspose.Words.Cloud.Sdk;
var config = new Configuration { ClientId = "####-####-####-####-####",
ClientSecret = "##################" };
var wordsApi = new WordsApi(config);
var fileName = "Input.docx";
using var requestFileContent = File.OpenRead(File.ReadAllText(fileName));
var uploadDocumentRequest = new UploadFileRequest(requestFileContent, fileName);
await wordsApi.UploadFile(uploadDocumentRequest);
var requestParagraph = new ParagraphInsert()
{
Text = "Reading and writing to the file in the cloud occurs automatically."
};
var insertParagraphRequest = new InsertParagraphRequest(fileName, requestParagraph);
await wordsApi.InsertParagraph(insertParagraphRequest);
var downloadDocumentRequest = new DownloadFileRequest(fileName);
await wordsApi.DownloadFile(downloadDocumentRequest);
Install 'Aspose.Words Cloud SDK for .NET' using NuGet package manager. Just run nuget install Aspose.Words-Cloud to automatically install and reference the corresponding assembly in your project. As an alternative, you can manually clone Aspose.Words Cloud SDK for .NET source code from GitHub and use it in your project. Please follow these Instructions to quickly get the necessary security credentials and access our REST API.
Refer to the Repository Documentation to see more details.