473,503 Members | 12,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using WinWord

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.]
Jul 27 '06 #1
8 2121
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Just D." wrote:
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.]
Jul 27 '06 #2
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:9E**********************************@microsof t.com...
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.
Jul 27 '06 #3
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/TechnicalRe...px?topic=1.xml

http://www.codeproject.com/aspnet/wo...select=1208979

http://www.codecomments.com/archive3...-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.

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:9E**********************************@microsof t.com...
>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.

Jul 27 '06 #4
"Just D." <no@spam.pleasewrote in message
news:Zf9yg.16668$Nv.9428@fed1read10...
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/Aspos...s/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...
Jul 27 '06 #5
"Just D." <no@spam.pleasewrote in message
news:Zf9yg.16668$Nv.9428@fed1read10...
Maybe so, but why should I pay for what I've got?
Forgot to include this:
http://www.aspose.com/wiki/default.a...utomation.html
Jul 27 '06 #6
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.

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:eE**************@TK2MSFTNGP04.phx.gbl...
"Just D." <no@spam.pleasewrote in message
news:Zf9yg.16668$Nv.9428@fed1read10...
>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/Aspos...s/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...

Jul 27 '06 #7
"Just D." <no@spam.pleasewrote in message
news:JCayg.16669$Nv.9134@fed1read10...
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?
Jul 27 '06 #8
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.
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:Ox*************@TK2MSFTNGP05.phx.gbl...
"Just D." <no@spam.pleasewrote in message
news:JCayg.16669$Nv.9134@fed1read10...
>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?

Jul 27 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8773
by: Bhavya Shah | last post by:
Hello there, I am facing a strange problem. I use office converters for converting Microsoft Word documents to html in my application. I use office automation for the entire process. I open the...
3
5592
by: John Mark Howell | last post by:
Does anyone know how I could view a WinWord Doc in a WinForm (other than convert to RTF or HTML)? I cannot convert it to RTF because I have drawn lines and they will not come through when...
0
1395
by: Just D. | last post by:
Guys, I'm writing the Windows Application and one of the ideas is to use a RichText field to store/show some formatted text, probably with pictures. The problem is that this RichEdit control is...
7
3876
by: Zeke | last post by:
I'm using the following code to create word document but the problem is if you go to task manager you'll see a WINWORD.EXE process is running but not the application, here is the code: ...
2
3846
by: Richard Loupatty | last post by:
I tried to start winword.exe from an aspx (after granting things with dcomcnfg) and i can see winword.exe showing up in the taskmanager, but i don't see the word-application itself. I did set...
3
11705
by: Dean Slindee | last post by:
The code below is being used to launch WinWord.exe from a VB.NET program. Word launches, but displays this error message: "Word has experienced an error trying to open the file. Try these...
2
4501
by: Dean Slindee | last post by:
The code below is being used to launch WinWord.exe from a VB.NET program. Word launches, but displays this error message: "Word has experienced an error trying to open the file. Try these...
16
9753
by: Asaf | last post by:
I am trying to create and use a COM object with C#.NET 2005. The assembly is set to "Register for COM interop" but when I am trying to call it from VB on Word 2003 I am getting this error: ...
1
2503
by: gazza67 | last post by:
Hi, I have a simple problem I am sure somebody can solve very easily. I want to do this; OpenFileDialog theDiag = new OpenFileDialog(); theDiag.ShowDialog(); Process.Start("winword",...
1
2046
by: tvjraman | last post by:
Visual Basic 6 I use Getobject() to get the object of Word application. I always get the first instance of Winword.exe I have a macro in another instance of Winword.exe I need to get the...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.