Solved

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

Posted on 2004-08-30
8
285 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

910 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

20 Experts available now in Live!

Get 1:1 Help Now