Solved

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

Posted on 2004-08-30
8
297 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

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!

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

624 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