Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Create Word.Doc from ASP Recordset

Hi, I have been trying to find information, to no avail, on creating and saving a Word.doc that got it's information from a recordset in an ASP page. Basically, the ASP creates the ADO recordset and the recordset is passed to a page that develops a Word Doc on the fly, basically a report that can be saved to the "C" drive and printed or e-mailed. Kinda wanna do this behind the scene. User clicks a save button and Wala it's saved on the hard drive.
Can someone suggest where I might find this info? Or guide me in a basic design from which I can build?

Comments

  • garwaingarwain Posts: 297Member
    basically what you want to do is create an OLE object to control word.

    I have written several pages in asp and programs in delphi that use an OLE object to create/modify excel sheets, but word can be controlled in exactaly the same way.

    do a search for OLE automation MSDN.microsoft.com has the full word object which will be a lot of help as well.

    Sorry I don't have any source code handy that I can send you. I'll write up a tutorial when I have a free afternoon (don't hold your breath waiting)

    : Hi, I have been trying to find information, to no avail, on creating and saving a Word.doc that got it's information from a recordset in an ASP page. Basically, the ASP creates the ADO recordset and the recordset is passed to a page that develops a Word Doc on the fly, basically a report that can be saved to the "C" drive and printed or e-mailed. Kinda wanna do this behind the scene. User clicks a save button and Wala it's saved on the hard drive.
    : Can someone suggest where I might find this info? Or guide me in a basic design from which I can build?
    :
    :

  • jeffy_khorjeffy_khor Posts: 163Member
    sorry for interupt, but if you have write that tutorial, please send to Jeff_Khor@hotmail.com
    Thank you.
  • mtndewmtndew Posts: 10Member
    : sorry for interupt, but if you have write that tutorial, please send to Jeff_Khor@hotmail.com
    : Thank you.
    :
    :In the end I decide to rewrite the entire procedure> I used "Response.Write("" & rs1("LName") & "")".
    This way it hard codes the data to an HTML page dynamically. I then used javascript to invoke the Saveas dialog box
    "document.execCommand("SaveAs",true,"30DaysHoldReport.htm");" allowing the user to save the html page to their harddrive. When it's reproduced they get all the data on an html page. They can e-mail it, print it, whatever. They still dont know from whence it came.
    Hope this helps someone.


  • woogorwoogor Posts: 7Member
    Here are my suggestions to you:

    1. Use the FileSystemObject to write ALL file information on your c drive (i.e. where your documents saved) to your DB;
    2. Retrieve ALL saved data from your DB, and display them in a table with asp/html;
    3. You need to set up some security rules to protect your files on saved on your c drive; and,
    4. When click on the <%=rs("documentname")%>, the Word document get opened.

    It took me 6 months to build this project for 4000+ users in a company wide.

  • bagles1bagles1 Posts: 54Member
    Here is a quick tutorial I found for ya on the net. It is written in VB but the concept and syntax will be the same. If you look at the example it should help you out tremendously on getting you where you need to go. (It even displays what the report format looks like before you do it. Good Luck!

    http://visualbasic.about.com/library/weekly/aa020401a.htm

    -Bagles1

    : Hi, I have been trying to find information, to no avail, on creating and saving a Word.doc that got it's information from a recordset in an ASP page. Basically, the ASP creates the ADO recordset and the recordset is passed to a page that develops a Word Doc on the fly, basically a report that can be saved to the "C" drive and printed or e-mailed. Kinda wanna do this behind the scene. User clicks a save button and Wala it's saved on the hard drive.
    : Can someone suggest where I might find this info? Or guide me in a basic design from which I can build?
    :
    :

  • arronleearronlee Posts: 34Member

    I used to create Word documents with the help of some 3rd party SDKs. I think it is a convenmient way. Btw, do you have any good recommendations about the related Word creating Toolkit? Thanks in advance.

    Best regards, Arron

Sign In or Register to comment.