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!

Generating Word documents from ASP 1

Status
Not open for further replies.

shweta

Technical User
Mar 20, 2001
27
0
0
US
Hi,

We need to generate a word document from an ASP page. I have tried by setting the Response.ContentType = "application/msword". This works wonderfully on Word 2000, but doesn't work on Word 97, or at least that's what I think.

Has anyone tried printing to Word 97 using this method? Or does anyone know of a better way to do this?

Thanks in advance!
Shweta
 
Have you tried Crystal Reports ?

Crystal Reports can export to many kind of formats, including Word.

Dv
 
Thanks DV!

The thing is we do not want to use Crystal Reports for this. This is a document that the user can edit and then get a printable version in Word.

Any other ideas?

 
Hi shweta

I have the same problem. Do you find the answer?
If Ok, could you send me the answer?

Thanks
Cilicie.
 
How does one create a word document in the first place from ASP? Does anyone have any code that could be used to do so? Is it like the FileScriptingObject.Write method?
Thanks
 
Try doing some research on OWC (Office Web Components). I know that from OWC you can create Excel spreadsheets, and what not, so that might be an answer for you.

Other than that, you will need to create an instance of Word application, then create the document that way. This can be a problem if you do not have total control over your server, as Word needs to be installed on the webserver itself.

here's a link for you:

very good example of how to do this.

all that emailing stuff doesn't apply to your situation, but the word code seems to answer your question.

hope this helps
leo
 
hi leo

I should use a .dot to build my word document.
I found a solution to do that but i have the following error:
LiaisonWord error '800a01ad'

ActiveX component can't create object

LiaisonWord is the component .
I have founded the solution on : It's in french but the code in english.
:)
thanks
cilicie
 
usually when you get an Active X component cannot create object, it means that the object wasn't registered, or registered improperly. Try re-registering it. If this doesn't solve your problem, then I don't know what it could be.

good luck
leo
 
Hi
I have found the problem. It comes from the server.
Word wasn't install on the server.
Be carefull , there is a mistake in the code.. They don't close word session using for read the .dot
Else it's a good component

bye Cilicie
 
This is what I did:

- Open the document you want to use in word.
- Convert it to a web page and save it somewhere.
- Copy the source into an ASP page, and insert the variables where they're needed.
- Insert Response.Content-Type = "application/msword" into this page. It will convert the html page back to word in your browser. I know you said that it works great for Word 2000, but I can't see why it wouldn't work in Word 97. _________________
Bixarrio
e = m * (c ^ 2)
 
Hi,

Say, Bixarrio, would you know how to make the browser just open the doc without prompting the user for download or open?

Thanks.
 
I have no idea why it's doing that! I started having that same problem today. Small word docs open without a problem, but the bigger ones don't. Sorry, I wish I could help. If I find out what's going on, I'll let you know. _________________
Bixarrio
e = m * (c ^ 2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top