asp to word RRS feed

  • Question

  • User97326088 posted

    can i save data from asp page to word file after user submit his data successfully

    Wednesday, November 25, 2009 4:18 AM

All replies

  • User121973971 posted

    You can use Word Automation, but you have to be careful about concurrency.  You could always deposit the data somewhere (database, etc.), and then have a single-threaded process build Word documents off-line.  Here's a sample of building a Word document from form inputs and returning it to the user from a Servlet:  http://www.cognitier.com/downloads/ServletWordDocSample.pdf.  It would be just as simple from an asp page.  The sample code doesn't show all of the Word Automation APIs available, but there are lots of on-line sources documenting the APIs.  If you don't need to return the Word document to the user who submitted the form, then I'm sure you would be better off using a scheduled process to build the documents from data you've already collected.

    Wednesday, November 25, 2009 2:15 PM
  • User97326088 posted

    brother can u give me link for asp pages

    Thursday, November 26, 2009 12:05 AM
  • User121973971 posted

    The COM APIs for MS Office automation can be found on MSDN.  Here's a sample link - http://msdn.microsoft.com/en-us/library/aa272097(office.11).aspx.

    When it's time to return the document to the user, the main requirement is to set the response header properly.  Here's a sample link discussing this topic - http://www.daniweb.com/forums/thread38650.html.

    Again, watch out for issues like concurrency and process identity. 

    Hope this helps.

    Monday, November 30, 2009 9:49 AM