473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Creating Word Document Issue

Hi all,

trying to create word document using following syntax in c#

private Word.ApplicationClass oWordApp = new Word.ApplicationClass();

Application throws error as :
Exception Details: System.UnauthorizedAccessException: Access is denied.

The ASP.NET process is not authorized to access the requested resource. For
security reasons the default ASP.NET process identity is
'{machinename}\ASPNET', which has limited privileges. Consider granting
access rights to the resource to the ASP.NET process identity.

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
"{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the
Write box in the Allow column.

But as per the security goes, i have ensured that machine\aspnet user has
full access to the folder and even i gave the full access to C: but still
the same error is showing. Can anyone help me on this.

Thanks
Arvind
Nov 19 '05 #1
2 1158
Arvind,

In the document
http://support.microsoft.com/default...b;en-us;257757 you will find
that Microsoft is strongly against using office automation on server side.
Nevertheless if you insist, you can do it. Try giving permission to ASPNET
user account to access word application
object. It can be done with dcomcnfg.exe

Eliyahu
"Arvind P Rangan" <ar******@hotmail.com> wrote in message
news:en**************@TK2MSFTNGP10.phx.gbl...
Hi all,

trying to create word document using following syntax in c#

private Word.ApplicationClass oWordApp = new Word.ApplicationClass();

Application throws error as :
Exception Details: System.UnauthorizedAccessException: Access is denied.

The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is
'{machinename}\ASPNET', which has limited privileges. Consider granting
access rights to the resource to the ASP.NET process identity.

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
"{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the
Write box in the Allow column.

But as per the security goes, i have ensured that machine\aspnet user has
full access to the folder and even i gave the full access to C: but still
the same error is showing. Can anyone help me on this.

Thanks
Arvind

Nov 19 '05 #2
Hi,

Maybe this will help
http://msdn.microsoft.com/vbasic/def...vbnettortf.asp

Ken
---------------------
"Arvind P Rangan" <ar******@hotmail.com> wrote in message
news:en**************@TK2MSFTNGP10.phx.gbl...
Hi all,

trying to create word document using following syntax in c#

private Word.ApplicationClass oWordApp = new Word.ApplicationClass();

Application throws error as :
Exception Details: System.UnauthorizedAccessException: Access is denied.

The ASP.NET process is not authorized to access the requested resource. For
security reasons the default ASP.NET process identity is
'{machinename}\ASPNET', which has limited privileges. Consider granting
access rights to the resource to the ASP.NET process identity.

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
"{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the
Write box in the Allow column.

But as per the security goes, i have ensured that machine\aspnet user has
full access to the folder and even i gave the full access to C: but still
the same error is showing. Can anyone help me on this.

Thanks
Arvind

Nov 19 '05 #3

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

Similar topics

6
by: Kerri McDonald | last post by:
We have an application where the user fills out many screens and when they are done, we are supposed to display the text they entered in a word or excel format. That is fairly easily accomplished...
0
by: Klein | last post by:
I have an application which can load ms word documents and save them. The application has a main form with a file menu, an edit menu and a tool bar. I have a DocumentControl(usercontrol) defined...
2
by: Arvind P Rangan | last post by:
Hi all, trying to create word document using following syntax in c# private Word.ApplicationClass oWordApp = new Word.ApplicationClass(); Application throws error as : Exception Details:...
7
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: ...
3
by: m3ckon | last post by:
Hi there, I can succesfully create a word doc from my asp.net page, but I have 2 issues I need to resolve in order to use it in my app: 1) Creating a table: I seem unable to create a table,...
2
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to...
2
by: tamaker | last post by:
I have a registration form where a user is able to, upon submission of the form, have their submission entered into a simple database... now Im looking to create a word document on the fly from...
0
by: PracticalApps | last post by:
I looked to find a canned solution to create a Word document in my application and just couldn't find anything that just gets to the point. I would think, and I may be making too strong of an...
10
by: cj2 | last post by:
I open a word template in VB and add values to the bookmarks then save the document as as pdf. When I then go to close the document it pops up a save as dialog box. It's already saved the...
2
by: uamusa | last post by:
I am Dynamically generating a proposal(report) in MS Word. By default the Paragraph Alignment is "Left". For the First 6 Paragraphs I set the Alignment to "Center", and then when attempting to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.