FileFormat.Words 23.8.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FileFormat.Words --version 23.8.0                
NuGet\Install-Package FileFormat.Words -Version 23.8.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FileFormat.Words" Version="23.8.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FileFormat.Words --version 23.8.0                
#r "nuget: FileFormat.Words, 23.8.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FileFormat.Words as a Cake Addin
#addin nuget:?package=FileFormat.Words&version=23.8.0

// Install FileFormat.Words as a Cake Tool
#tool nuget:?package=FileFormat.Words&version=23.8.0                

FileFormat.Words for .NET

Version 23.8.0 Nuget

Open-Source .NET Library For Word Document Automation

FileFormat.Words is an Open-Source .NET API to create customized Microsoft Word documents programmatically. This C# library is easy to install, robust, lightweight and offers a wide range of features to create and manipulate Word documents using a few lines of source code. FileFormat.Words is written in C# and is based on OpenXML that Microsoft backs. FileFormat.Words is a wrapper that makes use of OpenXML SDK immensely and enables developers to use its features easily. This Open-Source .NET library helps developers automate Word document generation & manipulation without depending upon any third-party library.

Library Features

FileFormat.Words not only offers provisions to create new Word documents but also lets developers read & modify the existing documents programmatically. This .NET library is user friendly and all the processes happen seamlessly.

This Open-Source .NET library offers the following features:

  • FileFormat.Words offers empty Word document creation as well as with the content. Developers can open an existing Word document from a file & stream.
  • This Open-Source API lets you add Paragraphs to the document. Developers can make the text Bold, Italic, and can set various properties such as alignment, style, and more.
  • Developers can add Tables using this Open-Source .NET API. There are many features offered by the Table namespace such as creating tables, setting table border style, and setting table width. In addition, developers can read tables along with all the properties (i.e. rows, columns, and more) from an existing Word document and can add/update/remove rows and cells. Further, it lets you edit the text inside table cells & more.
  • The Image class lets you add images with custom properties into a Word document.

Let's start

  • The installation procedure of this Open-Source .NET API is just one command away. Simply, run the following command in the NuGet Package Manager and you are all set to leverage this document automation library.

<code>Install-Package FileFormat.Words</code>

Create an Empty Word Document Programmatically

The following code snippet creates an empty Word document programmatically.

// 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");

Let's add some text to a Word document

The following code snippet adds a Paragraph to a Word document.

// 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.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"); 
}

Coming updates

FileFormat.Words is intended to add more features to its stack. Further, the development of FileFormat.Cells and FileFormat.Slides are a work in progress. So, stay tuned for the upcoming updates.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FileFormat.Words:

Package Downloads
FileFormat.Words.Examples

Explore a collection of concise C# examples and Gists showcasing efficient ways to manipulate Word documents using the FileFormat.Words C# API. Simplify document processing tasks with these practical code snippets for enhanced Word document handling.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
24.10.0 429 10/29/2024
24.9.0 473 9/20/2024
24.7.1 357 7/24/2024
24.7.0 253 7/9/2024
24.5.2 336 5/16/2024
24.5.0 146 5/15/2024
24.3.0 2,974 3/31/2024
24.2.0 1,183 2/5/2024
23.12.0 611 12/21/2023
23.10.0 432 11/6/2023
23.8.0 459 8/31/2023
23.6.0 356 6/16/2023