Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 January 5th, 2006, 11:28 AM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Word and Asp

Hi

I'm using this code to open a Word document and read it.

<%
docpath = "C:\doc1.doc"
set word = createobject("Word.Application")
text = word.documents.open(docpath).Content.Text
word.quit
response.write(text)
%>

The problem is that it looses all tables and images.
Does anybody know some way to read a word document widhout loosing the format?

Cristiano D. Silva
 
Old January 5th, 2006, 11:47 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Cristiano,

Are you trying to write a word document to the browser?

Cheers,

Chris

 
Old January 5th, 2006, 12:11 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm trying to view the document.

Cristiano D. Silva
 
Old January 5th, 2006, 06:55 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

This seems to simple to be your solution. Anyhow, you dont need to create any kind of object for this, use a regular anchor tag:

<a href="http://domainName.suffix/dirName/docName.doc" title="Open word doc in new window" target="_blank">Open Doc</a>

The:
target="_blank">
will open the doc in a new window. Remove this if you want to open it in the same window.

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening Word from ASP arnabghosh Classic ASP Basics 1 December 21st, 2005 10:58 AM
uploading word with asp hastikeyvan Classic ASP Basics 0 July 6th, 2005 12:19 AM
ASP and Microsoft Word, HELP! jbolles Classic ASP Professional 3 August 2nd, 2004 05:52 PM
ASP - Word Document mapaquin Classic ASP Professional 1 August 11th, 2003 06:17 PM





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