|
|
| Kagamoto@gmail.com 2006-10-31, 7:06 pm |
| Hello everybody!
I'm developing an ASP.NET (v1.1) web application which includes a
reference to the "Microsoft Word 11.0 Object Library".
When I try the following code:
....
....
Microsoft.Office.Interop.Word.Application app = new
Word.ApplicationClass();
....
....
I get an ASP.NET Error "System.UnauthorizedAccessException: Access
denied"
What can be the problem?
Thanks in advance!
Bye
| |
|
| When Word starts for the first time for a user it pops up a message box
asking your name and initials. When you start Word via your anonymous user
it will probably be popping the box up. The web service doesn't have access
to the desktop so you'll be getting the permission denied error.
You could temporarily allow the WWW service and the anon user access to the
desktop to allow you to complete the Word start-up process. However ideally
you shouldn't use Word (or any Office App) from asp.net as they are not
coded to be web suitable.
<Kagamoto@gmail.com> wrote in message
news:1162292779.532853.181440@h48g2000cwc.googlegroups.com...
> Hello everybody!
>
> I'm developing an ASP.NET (v1.1) web application which includes a
> reference to the "Microsoft Word 11.0 Object Library".
>
> When I try the following code:
>
> ...
> ...
> Microsoft.Office.Interop.Word.Application app = new
> Word.ApplicationClass();
> ...
> ...
>
> I get an ASP.NET Error "System.UnauthorizedAccessException: Access
> denied"
>
> What can be the problem?
>
> Thanks in advance!
> Bye
>
| |
| Kagamoto@gmail.com 2006-10-31, 7:06 pm |
| Ok, I've solved.
a)
Run DCOMCNFG.EXE , select Word Application - Properties - select
Security and add ASPNET to the Launch and Access permissions list.
or
b)
add <identity impersonate="true"/> to web.config
Thanks!
Kagamoto@gmail.com wrote:
> Hello everybody!
>
> I'm developing an ASP.NET (v1.1) web application which includes a
> reference to the "Microsoft Word 11.0 Object Library".
>
> When I try the following code:
>
> ...
> ...
> Microsoft.Office.Interop.Word.Application app = new
> Word.ApplicationClass();
> ...
> ...
>
> I get an ASP.NET Error "System.UnauthorizedAccessException: Access
> denied"
>
> What can be the problem?
>
> Thanks in advance!
> Bye
| |
|
|
|
|