Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate a form in a word document from an ASP

Status
Not open for further replies.

OceanDesigner

Programmer
Oct 30, 2003
173
0
0
US
I posted this in the Javascript forum with no luck. Maybe you ASP guys will have some ideas.

I have MS Word form and an ASP form that have the same fields. I want the user to open the ASP page and complete the ASP version. On submit, I send data to the database, and then open the DOC version in a new window. That is all pretty easy.

Here is the problem: I want to populate the fields in the DOC version with the info that was entered by the user in the ASP version, but I cannot figure out how to identify the DOC fields. The fields in the DOC are actually called bookmarks - I don't know if that makes a difference. I can't find any "bookmark" property. I would appreciate any help.

As an example lets take one field that holds a title:

ASP form name: myform
ASP field name: ASPTitle
DOC bookmark name: DOCTitle

The following javascript is my unsuccesful attempt:
Code:
function printform(){
 mywindow = window.open("CCB/ECRForm.doc")
 mywindow.documents.getElementByID("Title") = myform.Title.value
// mywindow.print()
}

Thanks, Jeff
 
If you have a connection to your db via your word doc, you should only have to refresh the merge. If the information is successfully input into the db by the ASP page, the update of the Word Doc has nothing to do with the Asp.

Set up your word doc, connect to the db, and re-run the merge and you will be fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top