4

How to generate Word document(doc,docx) in ASP.NET?

Csharp
  • 2,916
  • 16
  • 50
  • 77
amexn
  • 2,158
  • 6
  • 33
  • 56
  • Joel offers some tips for that here: [Why are the Microsoft Office file formats so complicated? (And some workarounds)](http://www.joelonsoftware.com/items/2008/02/19.html) – Nick Nov 10 '09 at 17:10

3 Answers3

8

You can create OpenXML documents using the Open XML SDK 2.0 for Microsoft Office. Note that this only applies to .docx, not .doc binary files from earlier versions of Word.

Documentation can be found here.

Grant Wagner
  • 25,263
  • 7
  • 54
  • 64
  • And you can augment that with docx4j.NET for stuff which isn't easy out of the box with the SDK, such as mail merge, XHTML import, PDF export. – JasonPlutext Mar 23 '14 at 21:51
2

You can use WordML to create Word 2003 docx: http://www.informit.com/guides/content.aspx?g=xml&seqNum=176

lod3n
  • 2,893
  • 15
  • 16
1

I suggest getting Aspose.Words

erikkallen
  • 33,800
  • 13
  • 85
  • 120