ASP.NET web app using MS Word on Server 2003

I've got an ASP.NET 2.0 (C#) application running on Windows 2003 Server and at a particular point it tries to create an instance of Word (2003) on the server to run macros and some document conversions.
This works fine on our dev (XP) machines but once we deploy it to the live server this fails.

Now I know that it's neither recommended nor supported but we've got to do it this way so I'm looking for help with the security settings.

In IIS the anonymous user is set to a user that currently has admin rights to the machine and that we can log in as, which I have done and opened Word while I was logged in.
 Integrated windows authentication is also on.
The application pool it's in is being run under the Network Service account.

In the DCOM config I have gone into the Microsoft Word Document entry and allowed launch and activation permissions on it for the anonymous user we're using, the network service account and the aspnet account. Then I've set the identity being used to the anonymous user.

And I've also switched on impersonation on the application so it should use the anonymous account to access resources.

But none of it makes any difference, it still doesn't work.
Now I know we've done this for other servers before but they were and therefore IIS 5 and it doesn't seem to have the same problems at all.

Does anyone have any ideas on other stuff I could try?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

just want to confirm whether you have word installed on the server?

maybe you also want to look at this option too

where is the file resideing .. the .doc file that has the macros .. is it within the same path as the web application and what are the presmissions on that file??

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Any time there is an access error, the quickest way I have found  to pinpoint the problem is using two utilities you can get free from called FileMon.exe and RegMon.exe. With them, you can trace the accesses and see precisely which access was denied.

capsoftukAuthor Commented:

Yes Word is definitely installed on the server, I opened it manually myself logged in at the IIS anonymous user that is also set as the identity user in the DCOM permissions.
There are no macros involved yet, what we're trying to do is to convert a .rtf to a .doc at the moment.
Down the line however there will be macros that need to be run on the documents on the server because we'll need to get into the guts of the document to convert strings to hyperlinks among other things.

I don't think what's discussed at that link really applies in this situation because I'm not actually going near the properties of the document.


I'm in the process of using those two already, I haven't turned up anything yet but I'm still looking.

The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

instead of anonymous user, did you try the code using windows authentication with the user having all the permissions .. regardless of whether you were able to open the file after you manually signed into that machine, i would first try by adding the file to the virtual path and giving all permission .. i also rmember that word used to use some temp files for file and so you needed write permission on some directory .. not sure whether its still applicable for newer versions of office ..

capsoftukAuthor Commented:
Someone else in my company has been working on this and changes they made (which I'm not fully aware of) plus a reboot have resolved the issue.
I'm splitting the points because both replies were resonable suggestions even though they the solution for me.
hi all,
i have the same problem but the previous solutions didn't help me.
i think that there is some settings or configurations with iis to execute Interop.Word code
i'm using vs 2008 and when my code run by virtual server there is no problem
but when run by iis raise error like word is busy

thanks in advance.
capsoftukAuthor Commented:
I can't remember exactly how we resolved this in the finish, I think the IWAM account that IIS runs under might also need permission to access Word in the DCOM settings. I think we gave Everyone full access in DCOM and then worked back from there, removing permissions and groups to narrow it down.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.