Word 2003 and DotNet

G

Guest

I have developed some reports using VB.Net and Word2003 whereby I create reports in word programmatically directly in a Word document. Now the user wants the same capability on the Web. I tried to create a web project that calls the VB.Net Forms application that develops the reports. I am able to include the VB.Net app's DLL and create an app object and I can access the public methods in the object, but when I try to create an object

Dim wdDetails As New Microsoft.Office.Interop.Word.Documen

I get a web error message saying, "Access is denied" along with the following informatio

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
--------------------------------
My question is, How do I give permission to ASP.Net to run Word2003 or is the .Net web version of Word development excluded by design

Thanks

James J.
 
M

Miha Markic [MVP C#]

Hi James,

You could give enough priveleges to asp.net account though I don't recommend
this approach since it is not meant in this way (Word is an interactive
beast).
Rather, I strongly suggest you to take a look at WordML (XML format of
Word2003 documents).
Check this link:
http://msdn.microsoft.com/office/un...y/en-us/dnofftalk/html/odc_office01012004.asp

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

James J said:
I have developed some reports using VB.Net and Word2003 whereby I create
reports in word programmatically directly in a Word document. Now the user
wants the same capability on the Web. I tried to create a web project that
calls the VB.Net Forms application that develops the reports. I am able to
include the VB.Net app's DLL and create an app object and I can access the
public methods in the object, but when I try to create an object
Dim wdDetails As New Microsoft.Office.Interop.Word.Document

I get a web error message saying, "Access is denied" along with the following information

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.the .Net web version of Word development excluded by design?
 
R

Robert Jacobson

Another article that might help:

INFO: Considerations for Server-Side Automation of Office
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757

Also, if WordXML doesn't work for you, another possibility is generating the
report as a RTF document (which could then be opened in Word, or copy/pasted
into Word.) The Winforms RichTextBox might help.


Miha Markic said:
Hi James,

You could give enough priveleges to asp.net account though I don't recommend
this approach since it is not meant in this way (Word is an interactive
beast).
Rather, I strongly suggest you to take a look at WordML (XML format of
Word2003 documents).
Check this link:
http://msdn.microsoft.com/office/un...y/en-us/dnofftalk/html/odc_office01012004.asp

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

James J said:
I have developed some reports using VB.Net and Word2003 whereby I create
reports in word programmatically directly in a Word document. Now the user
wants the same capability on the Web. I tried to create a web project that
calls the VB.Net Forms application that develops the reports. I am able to
include the VB.Net app's DLL and create an app object and I can access the
public methods in the object, but when I try to create an object
Dim wdDetails As New Microsoft.Office.Interop.Word.Document

I get a web error message saying, "Access is denied" along with the following information

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. is
the .Net web version of Word development excluded by design?
Thanks,

James J.
 
G

Guest

Dear Miha,

Thank you for the information. It is clear that Word is
not a very good Web solution. I will take the issue up
with my boss.

Thanks,

James J.
-----Original Message-----
Hi James,

You could give enough priveleges to asp.net account though I don't recommend
this approach since it is not meant in this way (Word is an interactive
beast).
Rather, I strongly suggest you to take a look at WordML (XML format of
Word2003 documents).
Check this link:
http://msdn.microsoft.com/office/understanding/xmloffice/ articles/default.aspx?pull=/library/en-
us/dnofftalk/html/odc_office01012004.asp

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

I have developed some reports using VB.Net and
Word2003 whereby I create
reports in word programmatically directly in a Word document. Now the user
wants the same capability on the Web. I tried to create a web project that
calls the VB.Net Forms application that develops the reports. I am able to
include the VB.Net app's DLL and create an app object and I can access the
public methods in the object, but when I try to create an object
Dim wdDetails As New Microsoft.Office.Interop.Word.Document

I get a web error message saying, "Access is denied"
along with the
following information
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. run Word2003 or is
the .Net web version of Word development excluded by design?
Thanks,

James J.


.
 

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