Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 28th, 2004, 04:26 PM
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP and Microsoft Word, HELP!

I need to pull data from a recordset and insert it into certain points of a word document that is on the server. Any advice/help you can give he would be awesome. I have already tried Response.ContentType but keep getting errors. Thanks in advance.

 
Old July 28th, 2004, 08:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You can connect using the Word API.

Brian
 
Old July 29th, 2004, 04:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

check out http://www.greggriffiths.org/webdev/both/excel/ which covers producing XL files from a Web Page, some of the content and links may give you some ideas as to how to create / populate a Word file.
 
Old August 2nd, 2004, 05:52 PM
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your help so far. I have inserted the following lines of code just before the HTML:

Response.ContentType = "application/msword"
Response.AddHeader "Content-Disposition", "attachment;filename=testword.doc"

From what I have read, this should prompt me to download a file called testword.doc, but instead the IE download window shows the filename being test.asp, the name of my asp file. The filetype parameter shows it is a Micrsoft Word file, however when I click Open or Save it gives the following error message:

"Internet Explorer cannot connect to test.asp"

I hope this helps clear up my problem.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Word to Picturebox omersharp C# 2005 0 September 5th, 2008 07:48 PM
Microsoft word and Acess keisha Access 3 February 15th, 2008 09:08 AM
what language was Microsoft Word developed in? mvick VB How-To 2 October 3rd, 2006 05:27 PM
How do I Read MicroSoft Word Docs with C#? MikeW C# 0 January 27th, 2005 04:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.