I would like to generate a word document from my ASP.NET application. Currently we show an "Agenda List" which is the agenda information and all items/subjects. This page needs to have the ability to open in word. The agenda page is not static, it's a dynamic list of agenda items pulled from SQL Server.
Any suggestions on the best solution? I'm looking for a quick solution and OpenXML seems to be a bit too time consuming. I'm open to purchasing third party tools.
Thanks!
Use the Office OpenXML SDK. For later versions of Office (2007 and above), this is the standard. There are other ways as mentioned in other answers, but OpenXML will give you the greatest level of control over the output.
Here is some documentation to get you started: http://msdn.microsoft.com/en-us/office/bb265236.aspx
You can either
Let the page generate the document yourself (like RTF format)
Save the Word template as XML and add your own placeholder where you fill in the content (I know you said this is time consuming which is true if you do a lot of updates to the template)
Used 3rd party tool like Aspose (http://www.aspose.com), it worked very well for me as it does save a lot of time to work with the document through objects in C#.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With