1. Home
  2.   Words
  3.   Openize.Words for .NET

Openize.Words for .NET

 
 

Manipulate WordProcessing Documents In C# ASP.NET Apps

Create, load and modify different contents of Microsoft Word documents including paragraphs, images and tables with just a few lines of code.

Openize.Words for .NET stands as a user-friendly and accessible Open-Source .NET API crafted for effortless crafting and customization of Microsoft Word documents. This intuitive C# library allows for the generation and manipulation of Word documents with minimal lines of code.

The installation of this lightweight solution proceeds seamlessly, offering an array of features to meet various document needs. Openize.Words harnesses the power of the OpenXML SDK, a technology endorsed by Microsoft. Serving as a convenient wrapper, Openize.Words simplifies the utilization of advanced capabilities.

Tailored with developers in consideration, this Open-Source .NET library provides the means to expand its functionalities by utilizing the OpenXML SDK library. Handling Openize.Words for .NET proves simple, owing to its user-friendly design. The library showcases an assortment of intelligent features, encompassing tasks such as adding new paragraphs, implementing text formatting, inserting, resizing, and rotating images, extracting images, modifying document properties, and much more.

Explore our GitHub repository to contribute, suggest improvements, and enhance this Open Source API: https://github.com/openize-words/Openize.Words-for-.NET

Previous Next

Getting Started with Openize.Words for .NET

The recommend way to install Openize.Words for .NET is using NuGet. Please use the following command for a smooth installation.

Install Openize.Words for .NET via NuGet

NuGet\Install-Package Openize.Words 
You can also download it directly from github.

Creating a Word Document Programmatically

The following code snippet creates an empty Word document programmatically.

Create a word document via .NET API

 
// Create an instance of the Document class.
Document doc = new Document();

// Invoke the Save method to save the Word document onto the disk.
doc.Save("/Docs.docx");

Add some text to a Word document

The following code snippet adds some text to a document programmatically.

Create a word document paragraph via .NET API


// Create an instance of the Document class.
using (Document doc = new Document())
{
    //Initialize the constructor with the Document class object.
    Body body = new Body(doc);
    // Instantiate an instance of the Paragraph class.
    Paragraph para1 = new Paragraph();
    // Set the text of the paragraph.
    para1.AddRun(new Run { Text = $"This is a Paragraph." });
    // Invoke AppendChild method of the body class to add a paragraph to the document.
    body.AppendChild(para1);
    // Call the Save method to save the Word document onto the disk.
    doc.Save("/Docs.docx"); 
}

More Code Examples and Resources

Explore more detailed code examples at Openize Gists.