Word automation from ASP.Net (VB)

S

Stu

Hi,

I am trying to read values out of a word document using vb.net. I have
created all the references and tried to run the code below but I get an
access denied error. I t doesn't, however, say which file access is denied
to. Has anyone any idea what I am doing wrong/how to fix this?

Dim oWordApp As Word.Application
Dim oWordDoc As Word.Document
oWordApp = New Word.Application '<<<<<<<< generates error messsage below
oWordDoc = oWordApp.Documents.Open(sPath)

Does anyone know how to remedy this?

Thanks in advance,

Stu


--/ Snip /--
Access is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access is denied.
ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access.
Source Error:

Line 200: Dim oWordDoc As Word.Document
Line 201:
Line 202: oWordApp = New Word.Application
Line 203: oWordDoc = oWordApp.Documents.Open(sPath)
Line 204:

Source File: C:\Inetpub\wwwroot\OTISII\DocumentViewer.aspx.vb Line: 202

blah....
--/ Snip /--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top