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? **
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).