Access denied...

K

Kagamoto

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
 
A

Aidy

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.
 
K

Kagamoto

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!
 
M

Mark Rae

I'm developing an ASP.NET (v1.1) web application which includes a
reference to the "Microsoft Word 11.0 Object Library".

You'd be well advised not to even try to do this. Server-side instatiation
of Microsoft Office is to be avoided if at all possible - even Microsoft
strongly advise against it to the extent where they won't actually support
any solution which uses it...
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2

Use this instead:
http://www.aspose.com/Products/Aspose.Words/Default.aspx

And have a read of this too:
http://www.aspose.com/wiki/default.aspx/Aspose.Total/WhyNotAutomation.html
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top