Using WinWord

J

Just D.

All,

What exactly should we do to get WinWord working in asp.net? I wrote a class
library and it works just great in WinApp. When I switched to the WebApp I
can't get the object because of permissions. But the problem is that I added
all required permissions first - using Component Services, second - to NTFS
permissions. It still doesn't work as expected. I saw many articles on the
Internet, the best ones were about DCOMCNFG.EXE and its using to grant the
executiuon permissions to the IIS anonymous user. I did that - no luck.
What's that, a new MS joke?

Just D.


Access is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access is denied.

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.

To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access.

[UnauthorizedAccessException: Access is denied.]
 
G

Guest

Just D.,
No, it's not a new "MS joke". Word, Excel and other Office applications have
COM Object Libraries that you can reference from .NET under the COM tab in
Add Reference, but these applications were never designed to be free-threaded
COM Servers that you can expect to use reliably in an ASP.NET application.

Depending on what exactly it is you want to do, Word, Excel and other Office
apps do have Office Web Components equivalents that are safer to use, as
well, there are a number of third-party components by Aspose and other
vendors that you can use.
If you decide you want to use an Office Application object model on your
ASP.NET application, be advised that you are "on your own".
Peter
 
M

Mark Rae

Depending on what exactly it is you want to do, Word, Excel and other
Office
apps do have Office Web Components equivalents that are safer to use, as
well, there are a number of third-party components by Aspose and other
vendors that you can use.

Aspose is, without doubt, the way to go. Superb suite of products.
 
J

Just D.

Maybe so, but why should I pay for what I've got? And I'm also pretty sure
that these 3-party components are also using the same wrappers to MS Office
because there is no reason to rewrite the whole office if we can use
automation. My task was pretty simple and it's already implemented as a
class library, it took a couple pages of the code to do that. I need a
simple converter for the word compatible files to convert them from one
format to another format without any interface and complication and it works
in WinApps. There are many recommendations on the Internet how to get it
working in WebApps, for example:

http://www.tek-tips.com/viewthread.cfm?qid=262340



http://www.ecrion.com/XF/TechnicalResources/Kb.aspx?topic=1.xml



http://www.codeproject.com/aspnet/wordapplication.asp?df=100&forumid=15166&exp=0&select=1208979



http://www.codecomments.com/archive319-2005-4-472361.html



But the best message I've seen was that the things changes after the Service
Pack 2 and we have to play with permissions manually to get it working. I
want to know the step-by-step instruction hot to get it working. I can tell
the steps that I did, but they are mostly described in the links above.

Just D.
 
M

Mark Rae

Maybe so, but why should I pay for what I've got?

Because what you've got is totally unsuited to what you're trying to use it
for... MS-Office is a suite of desktop products, totally unsuited to being
used over the web.
And I'm also pretty sure that these 3-party components are also using the
same wrappers to MS Office

Aspose certainly isn't!
http://www.aspose.com/Products/Aspose.Words/Default.aspx
"Aspose.Words enables .NET and Java applications to read, modify and write
Word® documents without utilizing Microsoft Word®. Aspose.Words enables .NET
and Java applications to read, modify and write Word® documents without
utilizing Microsoft Word®."

When you use Aspose, you specifically DO NOT install Word on your
webserver...
 
J

Just D.

Are you working for this company? :)

The starting "total" starts from 2000... Brrr. For one simple task -
nonsense. Also when I wanted to get a Text=>PDF converter to get our
reportes well formatted and readable by Word I wrote it for one evening.
 
M

Mark Rae

Are you working for this company? :)

Yeah, I'm the CEO.
The starting "total" starts from 2000... Brrr. For one simple task -
nonsense. Also when I wanted to get a Text=>PDF converter to get our
reportes well formatted and readable by Word I wrote it for one evening.

Well good for you - what's your problem then? Why are you posting in here?
 
J

Just D.

Permissions. I need some working way to set the appropriate permissions to
get it working in WebApp. Same class library works in WinApp. The links that
I included into the previous message didn't actually help, the exception
still persists. I can catch this exception but it doesn't change anything
because the interop doesn't work in WebApp. That's why I posted the original
message to this newsgroup, maybe somebody walked the same way and know the
details.
 

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

Top