Error opening word file in asp.net

asp.net , ms offfice , iis 5.0 India
  • 11 years ago
    I am trying to opening Word file in asp.net application. I Try Following Code For That, Private oWordAppl As Word.Application Private oDoc As Word.Document Public Sub New() oWordAppl = New Word.Application End Sub Public Sub Open(ByVal strfileName As String) Dim fieName As Object = strfileName Dim readOnly1 As Object = False Dim isVisible As Object = True Dim missing As Object = System.Reflection.Missing.Value oDoc = oWordAppl.Documents.Open(fieName, missing, readOnly1, missing, missing, missing, missing, missing, missing, missing, missing, isVisible) oDoc.Activate() End Sub And this code for Opening file, Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click Dim Test As New WordAppl Dim TamplatePath As String = ConfigurationManager.AppSettings("WordMod") Dim DocumentPath As String = ConfigurationManager.AppSettings("WordDoc") Test.Open(TamplatePath & "Test.Doc") Test.SaveAs(DocumentPath & "Test.Doc") Test.Open() End Sub All this works fine in View In Browser, But when I publish that Page The file not opening and on Click of Button, Browser running continuosly, but cant find file. **Is this problem giving path in IIS? **

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“XML is like violence - if it's not working for you, you're not using enough of it.”