Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

SharpDocx

> 编程语言
Open source

Lightweight template engine for creating Word documents

378 stars0 likes0 views
WebsiteGitHub

About

Lightweight template engine for creating Word documents

SharpDocx

Lightweight template engine for creating Word documents

Generating documents with SharpDocx is a two step process. First you create a view in Word. A view is a Word document which also contains C# code. Code can be inserted anywhere, e.g. would insert the current date and time.

The next step is to create documents based on this view. This requires two lines of code:

csharp
var document = DocumentFactory.Create("view.cs.docx");
document.Generate("output.docx");

Out of the box SharpDocx supports inserting text, tables, images and more. See the Tutorial sample (here's the view and the controller, and here's the generated document).

If you want, you can specify a view model to be used in your view. Then you could write things like .

csharp
var document = DocumentFactory.Create("view.cs.docx", myModel);
document.Generate("output.docx", myModel);

See also the Model sample.

If you want to do something that's not supported by SharpDocx, you can do so by creating your own document subclass. See the Inheritance example.

SharpDocx supports .NET Framework 3.5-4.8 and .NET Standard 2.0. Since it supports .NET Standard 2.0 it can be used in .NET Core 3.1, .NET 5.0 and .NET 6.0 projects as well.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#docxmicrosoft-wordmvcopen-xml-sdk

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言