Solved

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

Posted on 2004-08-30
8
282 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
  • 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now