G
Guest
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.Applicati
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic
Dim thisDoc As New Word.Documen
thisDoc = WordApp.Documents.Ad
With thisDo
.Range.InsertAfter("Printing with Word"
.Paragraphs.Item(1).Range.Font.Bold = Tru
.Paragraphs.Item(1).Range.Font.Size = 1
.Range.InsertParagraphAfter(
.Paragraphs.Item(2).Range.Font.Bold = Fals
.Paragraphs.Item(2).Range.Font.Size = 1
.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"
Tr
.PrintOut(True, True
Catch ex As Exceptio
MsgBox(ex.Message
End Tr
End Wit
WordApp.Quit(
End Su
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 file
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 Yo
Tom C
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.Applicati
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic
Dim thisDoc As New Word.Documen
thisDoc = WordApp.Documents.Ad
With thisDo
.Range.InsertAfter("Printing with Word"
.Paragraphs.Item(1).Range.Font.Bold = Tru
.Paragraphs.Item(1).Range.Font.Size = 1
.Range.InsertParagraphAfter(
.Paragraphs.Item(2).Range.Font.Bold = Fals
.Paragraphs.Item(2).Range.Font.Size = 1
.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"
Tr
.PrintOut(True, True
Catch ex As Exceptio
MsgBox(ex.Message
End Tr
End Wit
WordApp.Quit(
End Su
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 file
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 Yo
Tom C