2

Possible Duplicate:
How can a Word document be created in C#?

In one of my application i need to generate the word document from the C# code. like we are using the sql as database and we are storing the inventory data from the c sharp code to sql database.

Community
  • 1
  • 1
Rajpurohit
  • 1,951
  • 2
  • 16
  • 19

3 Answers3

3

There are third-party libraries to help, but if you want to develop a solution yourself, you may want to get hold of the Open XML SDK.

I recommend that rather than creating a Word document completely in code, you create a template document using Microsoft Word and then modify it using the Open XML SDK.

Don't be tempted to use Word Automation if you're producing the document on a server. Apart from being unsupported, it's somewhat prone to resource issues.

I blogged some time ago about inserting images into Word documents using Open XML.

Steve Morgan
  • 12,978
  • 2
  • 40
  • 49
0

How to automate Microsoft Word to create a new document by using Visual C#
http://support.microsoft.com/kb/316384

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Arjun Shetty
  • 1,575
  • 1
  • 15
  • 36