Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

I can open .XLS files using ASP through FTP, but how do I open .DOC files?

Posted on 2004-08-30
8
Medium Priority
?
299 Views
Last Modified: 2010-05-18
I have a website I'm developing, and I need to allow users to open Microsoft Office 2000 documents within their browsers.  They also need to be able to edit and save the documents.  To accomplish this, I've set up an FTP server where the files are kept, and granted the users read/write access.  Here is the source code I've got:

Sub OpenDOC(strLocation)
      Set objWord = CreateObject("Word.Application")
      objWord.Documents.Open strLocation
      objWord.Visible = true
      objWord.UserControl = true
End Sub

Sub OpenXLS(strLocation)
      Set objExcel = CreateObject("Excel.Application")
      objExcel.Workbooks.Open strLocation
      objExcel.Visible = true
      objExcel.UserControl = true
End Sub

The links look like this:

<a href="#" onClick="call OpenXLS('ftp://serveripaddress/filename.xls')">filename.xls</a>
<a href="#" onClick="call OpenDOC('ftp://serveripaddress/filename.doc')">filename.doc</a>

The Excel file works just fine.  The problem is that, when I try to open the Word document, I get the following error:

Line: 14
Error: The document name or path is not valid.
Try one or more of the following:
* Check the path to make sure it was typed correctly.
* On the File menu, click Open.  Search for the file using this dialog box.
(ftp://serveripaddress/filename.doc)

I am certain that the path and filename is correct; in fact, if I go to Microsoft Word, and File->Open, and type in that same exact path, it will work fine.  What boggles my mind is that the webstie works fine for opening Excel files, but it doesn't seem to like Word.  Can anyone tell me what I'm doing wrong?
0
Comment
Question by:kevinowens
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
8 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11936755
Don't do this:

Sub OpenDOC(strLocation)
     Set objWord = CreateObject("Word.Application")
     objWord.Documents.Open strLocation
     objWord.Visible = true
     objWord.UserControl = true
End Sub


Microsoft warns against it:

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q257/7/57.ASP&NoWebContent=1

0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11936771
You might want to consider the use of Office Web Components:

http://www.microsoft.com/resources/documentation/office/2000/all/reskit/en-us/70t2_8.mspx

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11936784
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
kevinowens earned 0 total points
ID: 11936809
Hey, thanks for the advice--I spent just a little more time playing around, and it seems like it was a problem with my FTP sites that were set up in Microsoft Word.  It seems that the FTP site was trying to login as someone, but it should have been logging in anonymously.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11936902
Okay, I am glad that you have this sorted out.

Please don't forget to maintain this question. For details, see:

http://www.experts-exchange.com/Web/Web_Languages/ASP/help.jsp#hs5

Fritz the Blank
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11951821
If nothing I posted was at all helpful, then I suppose that a delete is okay.

FtB
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question