Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access denied to open word application

Status
Not open for further replies.

drew10

Programmer
Feb 26, 2002
123
US
I have a web app that allows users to upload ms word documents to a folder. I have a reference to MS Word. After the file is saved as a .doc file, I would like to convert it to html. My code is as follows:
Code:
Private sub convertToHtml(ByVal documentPath as string, ByVal htmlPath as string)

  Dim app as word.application
  app = new word.application

  dim doc as word.document = app.documents.open (documentPath)

  dim newFilePath as string = htmlPath & Path.GetFileName(documentPath)

  doc.SaveAs(newFilePath, 8)
  app.Documents.Close()
  GC.Collect()

End Sub

The problem is, everytime it attempts to set app = new word.application, I receive an error message saying access is denied.

I'm stumped at this point. Any help would be greatly appreciated.
 
Does the ASP.NET user have rights to write with Word to the directory your want?

Kris
[borg2]
 
It doesn't even get that far. It errors when it tries to create a new application.

app = new word.application()
 
The only thing that I can think of is that your aspnet user doesn't have the proper rights on the .dll that spawns the object...

Locate that file, and ensure that it does.

paul
penny1.gif
penny1.gif
 
Make sure Microsoft Word Document DCOM server application has launch permissions for the user ASPNET. You can enable this by running dcomcnfg command from command prompt. Select Microsoft Word Document under application tab, select Default security tab and give launch permissions.

HTH

Xavier
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top