asp.net and creating word docs on the server

  • Thread starter matthew rutherford via .NET 247
  • Start date
M

matthew rutherford via .NET 247

When I use the word automation object (registered word10 andusing the namespace in the .cs file)
I get 'access denied' error when trying to run the thing on mylocal pc. I am using the ASPNET user.

I have heard this is due to the ASPNET user never having openedword before and it is subsequently prompted by word for ausername and password dialog, which obviously ASPNET canthandle. I can actually hear the system beep as the dialog iscalled in the background when testing the ASPX page on mylocalhost but after this i guess it just times out, returningthe access denied error.

I have used dcomcnfg.exe and ASPNET has full access to the wordapplication.

What is the solution?

I have tried changing the user context in web.config but to noavail ie still the access denied message.

Somebody must have come across a solution to this.
 
S

Steve C. Orr [MVP, MCSD]

Using COM automation to interact with Word on the server is not a very good
idea.
This article covers various options for generating Word & Excel documents:
http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/asp200309so_l.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


When I use the word automation object (registered word10 and using the
namespace in the .cs file)
I get 'access denied' error when trying to run the thing on my local pc. I
am using the ASPNET user.

I have heard this is due to the ASPNET user never having opened word before
and it is subsequently prompted by word for a username and password dialog,
which obviously ASPNET cant handle. I can actually hear the system beep as
the dialog is called in the background when testing the ASPX page on my
localhost but after this i guess it just times out, returning the access
denied error.

I have used dcomcnfg.exe and ASPNET has full access to the word application.

What is the solution?

I have tried changing the user context in web.config but to no avail ie
still the access denied message.

Somebody must have come across a solution to this.
 

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

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top