Re: Granting ASP.NET write access to a file

From: Steve C. Orr [MVP, MCSD] (Steve_at_Orr.net)
Date: 04/24/04


Date: Fri, 23 Apr 2004 23:18:34 -0700

It sounds like you're using Windows XP.
To enable the security tab you must disable simple file sharing.
To do this, open any windows explorer window and choose Folder Options from
the Tools dropdown menu.
Then go to the View tab.
Scroll to the bottom of the list and uncheck the Use Simple File Sharing
checkbox and click the OK button.

-- 
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Tom C." <anonymous@discussions.microsoft.com> wrote in message
news:2DCD51CD-7D15-4F39-ACD0-0D04F517C60D@microsoft.com...
> Hi,
>
> I'm trying to create a web form that will print a MS Word doc from the web
form. I'm using VB.net.
>
> This is the code example:
>
> Dim WordApp As New Word.Applicatio
>     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
>         Dim thisDoc As New Word.Document
>         thisDoc = WordApp.Documents.Add
>         With thisDoc
>             .Range.InsertAfter("Printing with Word")
>             .Paragraphs.Item(1).Range.Font.Bold = True
>             .Paragraphs.Item(1).Range.Font.Size = 14
>             .Range.InsertParagraphAfter()
>             .Paragraphs.Item(2).Range.Font.Bold = False
>             .Paragraphs.Item(2).Range.Font.Size = 12
>             .Range.InsertAfter("This is the first line of the test
printout")
>             .Range.InsertParagraphAfter()
>             .Range.InsertAfter("and this is the second line of the test
printout")
>             Try
>                 .PrintOut(True, True)
>             Catch ex As Exception
>                 MsgBox(ex.Message)
>             End Try
>         End With
>         WordApp.Quit()
>     End Sub
>
>
> It works when I run this in a Windows Application but when I run it in a
webform I get an error that say's "ASP.NET is not authorized to access the
requested resource"
>
> Then it tells me "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."
>
> I've tried this but there is no security tab in the properties page for MS
Word, or for .doc files
>
> In the past I've granted ASP.NET access to SQL server through the
Enterprise Manager but i can't find anything like that for word.
>
> Does anyone know how Grant ASP.NET Access to MSword or other Office
Components?
>
> Thank You
>
> Tom C.
>