Hi,
I have created a class library project in VB.NET and created an instance of
the word application object using:
Dim WordApp As Word.Application = New Word.Application
I have then used the application object to create a document and save it.
I have created a VB.NET windows project and called the above code from a
windows form OnLoad event. The code runs fine.
I have then added a reference to the class library from an ASP.NET
application and the called the above code from within a web forms pageload
event.
I am getting an Access is denied error (details at bottom of this message).
I have tried adding full permissions to the folder that contains the word
files - C:\Program Files\Microsoft Office\OFFICE11 for both the ASP.NET
account and even the 'Everyone' group. I am still getting the permission
denied error (see below).
Can anyone help?
thanks,
TomJangles
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.
Chuck Hartman - 18 May 2005 17:19 GMT
Tom,
You cannot achieve your goal by adding file system permissions alone. You
need to access Code Access Security permissions as well. That is done with
the .Net Framework Configuratin Tool.
However, what specific functions are you trying to perform with Word on the
server side? Even if it could be done, you will probably find that running
Word on the client and having your VSTO project talk to the server over
various methods will achieve more desirable results.
Chuck Hartman
> Hi,
>
[quoted text clipped - 34 lines]
> impersonate="true"/>, the identity will be the anonymous user (typically
> IUSR_MACHINENAME) or the authenticated request user.
Ken Laws [MSFT] - 18 May 2005 17:55 GMT
Hi Tom,
Server side automation of Microsoft Office applications is not recommended.
You can find more information concerning issues that may be encountered with
server side automation, such as the "Access denied" error that you are
receiving from Knowledge Base article 257757, link included below.
257757 INFO: Considerations for Server-Side Automation of Office
http://support.microsoft.com/?id=257757
Regards,
Ken Laws
Microsoft Support
This posting is provided "AS IS" with no warranties, and confers no rights.
For more information regarding Visual Studio Tools for Office 2005:
Best of Blogs: Visual Studio 2005 Tools for Offic
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_2003_ta/htm
l/odc_landvsto2005_ta.asp
Visual Studio Tools for Office Forum
http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=16
Visual Studio Tools for the Microsoft Office System
http://msdn.microsoft.com/office/understanding/vsto/default.aspx
> Hi,
>
[quoted text clipped - 31 lines]
> impersonate="true"/>, the identity will be the anonymous user (typically
> IUSR_MACHINENAME) or the authenticated request user.