Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 5th, 2006, 11:28 AM
Registered User
 
Join Date: Jan 2006
Location: BH, Minas Gerais, Brazil.
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
Reply With Quote
  #2 (permalink)  
Old January 5th, 2006, 11:47 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
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

Reply With Quote
  #3 (permalink)  
Old January 5th, 2006, 12:11 PM
Registered User
 
Join Date: Jan 2006
Location: BH, Minas Gerais, Brazil.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm trying to view the document.

Cristiano D. Silva
Reply With Quote
  #4 (permalink)  
Old January 5th, 2006, 06:55 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.