Generate Word document from c# [duplicate]
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 inventor开发者_如何学Cy data from the c sharp code to sql database.
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.
Hi please have a look into below link its realy good to understand the word automation.
http://www.c-sharpcorner.com/UploadFile/amrish_deep/WordAutomation05102007223934PM/WordAutomation.aspx
http://vscontrols.blogspot.com/2010/09/genrate-table-of-files-in-directory.html
server side document genration
http://msdn.microsoft.com/en-us/library/bb735940(v=office.12).aspx
http://blogs.msdn.com/b/brian_jones/archive/2009/01/19/pushing-data-from-a-database-into-a-word-document.aspx
How to automate Microsoft Word to create a new document by using Visual C#
http://support.microsoft.com/kb/316384
精彩评论