DocX Getting Started

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

DocX is a NuGet library that allows you to manipulate Word files, in a simple and easy manner. It is fast, lightweight and the most important advantage of using this library is that it does not require Microsoft Word or Office to be installed.

Features

  • Create new Word documents
  • Modify Word documents
  • Supports *.docx format from Word 2007 and later
  • Modify multiple documents in parallel for better performance
  • Apply a template to a Word document
  • Join documents, recreate portions from one to another
  • Supports document protection with or without password
  • Set document margins and page
  • Set line spacing, indentation, text direction, text alignment
  • Manage fonts and font sizes
  • Set text color, bold, underline, italic, strikethrough, highlighting
  • Set page numbering
  • Create sections

Installation

You can easily install it from the Package Manager Console window by running the following command.

PM> Install-Package DocX

Environment Setup

To start using the DocX in your application, you will need to install the DocX NuGet package.

Let's open the Visual Studio and create a new project.

image

Select the Create a new project option.

image

Choose C# as language, Windows as a platform, and Console as the project type. In the template pane, select Console App (.NET Framework) and click the Next button.

image

Enter the project name, you can change the location and solution name, but we will leave it and click on the Next button.

image

You can see a new web application project is created. Now to install an DocX, right-click on the project in Solution Explorer, and select Manage NuGet Packages...

image

Select the Browse tab and search for DocX and install the latest version by pressing the Install button.

image

Once DocX has been successfully installed. You are now ready to start your application.



Got any DocX Question?