Go Premium for a chance to win a PS4. Enter to Win

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
?
302 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
6 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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…
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Integration Management Part 2
Suggested Courses

782 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