PJW
PJW

Reputation: 5417

creating word documents from a winforms application

I have a C# winforms application with a sql server backend and want to be able to create word documents from within my application and populate them with basic information like addresses, references etc. I've been browsing online for ideas but am struggling getting started on this subject.

Could someone please point me in the right direction.

Upvotes: 1

Views: 2429

Answers (2)

isioutis
isioutis

Reputation: 324

What you need to look for are Report Designers , where you can edit them from code and export in many formats including word , pdf etc. you can look for Crystal Reports , Devexpress XtraReports and also there are many that are free .

Upvotes: 1

Steve
Steve

Reputation: 216343

As a starting point go to this link Office Development With Visual Studio then download and install the requested libraries.

The subject is very broad and cannot be answered with precise details.
However just as you have requested, this is a direction:

  • Create a DOT document and fill it with MergeFields where the data from SqlServer will be written to.
  • Add the references to the Office Interop Word library in your project
  • Declare the required Application and Document instance vars
  • Read your data from the database and open the DOT file using the Office Word library
  • Search in the DOT file the relative MergeField and update its text
  • Save the DOT file as document in your folder.

As you can see, each of these steps worth questions by itself. So you have a lot of work to do

Upvotes: 3

Related Questions