Solved

Problems with creating a Word Document on a server

Posted on 2004-03-24
14
736 Views
Last Modified: 2007-12-19
I am trying to create a Word document on my server through an ASP.

I keep getting an error message 80020009 System cannot find path specified.

        wordApp.visible = false  
        MyDocName = "C:\Learn_Style1.doc"
        WordDoc = wordApp.documents.Open(MyDocName)

It appears the error is on the visible = false statement.

I ran the code on my local PC to get it working, then converted it to a DLL to run in an ASP page.

Thanks
Chris
0
Comment
Question by:houserc
  • 8
  • 6
14 Comments
 
LVL 2

Expert Comment

by:MrPan
Comment Utility
Chris

I would try checking if the file exist using the DIR command. It could be that IIS can not see outside off its folder. Try looking at the folder securities might be a bit of a red herring but I know you have to set the folders up in iis.

I would put the word document in a folder off of the asp folder and use the map server command I will post an example

MrPAn
0
 
LVL 2

Expert Comment

by:MrPan
Comment Utility
Try this then move the word doc into a folder off of the main app called docs then try this code

wordApp.visible = false  
MyDocName = Server.MapPath("DOCS\Learn_Style1.doc")
WordDoc = wordApp.documents.Open(MyDocName)

0
 

Author Comment

by:houserc
Comment Utility
My problem seems to be in the path to WORD on my server.

Is there anything I need to do to get my DLL to "see" where word is on the server?

This ASP works fine on my local machine, so the functionality is there, it just can't find the WORD application on the server.
0
 
LVL 2

Expert Comment

by:MrPan
Comment Utility
Intresting, You may have to open up the OFFICE folder on the IIS server. I think you add the folder as a virtual server.

This example seems to confirm you code is correct and the process should work

http://www.serverwatch.com/tutorials/article.php/1493361
0
 
LVL 2

Accepted Solution

by:
MrPan earned 330 total points
Comment Utility
Also what error are you getting?
0
 

Author Comment

by:houserc
Comment Utility
The message I'm getting is;

CREATEFORMS error '80020009'

Runtime error occurred in Program CREATEFORMS at Line 28: Access is denied. (0x80070005)

I've got my DLL running under the profile of an administrator on the server, the document is accessable to everyone.
0
 

Author Comment

by:houserc
Comment Utility
Also, line 28 use to be;

Application.visible = false

Now it is;

    Application.Documents.Open(FileName,,,,,,,,,,,)

And I'm still getting the same error.

Is there a setting on the server that limits Word processing?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:houserc
Comment Utility
I tried running the example you gave me above and I get this message;

Microsoft Word error '800a16c1'

Object has been deleted.

/mydoc.asp, line 5
0
 

Author Comment

by:houserc
Comment Utility
I ran dcomcnfg.exe and set the identity to run under the same user all the time. Now, I'm getting the following error:

Microsoft VBScript runtime error '800a0046'

Permission denied: 'CreateObject'

/mydoc.asp, line 4


Any help would be appreciated.
0
 

Author Comment

by:houserc
Comment Utility
This has been increased point wise.
0
 

Author Comment

by:houserc
Comment Utility
The answer is that Microsoft never meant for Office applications to run from a server. Microsoft documented it very well on their website and states 5 major reason for NOT using Word, or anything Office product, from the server.

One of these is scalability, one is that the products were never meant to be run anywhere but on a desktop and need a profile to run, and one that I had not even considered was that fact that Office Applications have no security built in. The last one means that anybody, outside of your office using the application, could do severe damage.

So, I'm off to looking to other avenues.

I'm awarding the points to MrPan, since he was the only one that replied and tried to assist me.  Thank's MrPan!
0
 
LVL 2

Expert Comment

by:MrPan
Comment Utility
Thanks for the points you could look at something like activePDF which I use for generating PDFs on the fly. It might be a bit pricy but there are other similar products out there.

I think their website is www.activePDF.com
0
 
LVL 2

Expert Comment

by:MrPan
Comment Utility
You could try writing that data to a table in a database. Monitor the file with a program not running on the web server. Create the document (from the data) and then ftp the word document to the server.
0
 

Author Comment

by:houserc
Comment Utility
What I did in this instance was;
Save the Word document as HTML.
Convert the HTML to XSLT
Then substituted in the variables from an XML document
and used FSO to save the object prior to displaying it.

PDF would have been cleaner and easier, but my client wanted them to be word documents.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 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

10 Experts available now in Live!

Get 1:1 Help Now