FileFormat.Words
23.8.0
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
<PackageReference Include="FileFormat.Words" Version="23.8.0" />
paket add FileFormat.Words --version 23.8.0
#r "nuget: FileFormat.Words, 23.8.0"
// 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
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 | Versions 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. |
-
.NETCoreApp 3.1
- DocumentFormat.OpenXml (>= 2.20.0)
-
net7.0
- DocumentFormat.OpenXml (>= 2.20.0)
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.