i need to upload a word document file and convert into textfile and read
my program work fine while running on my localhost
but when it goes to server this app not working and give me error like this
=============================================
The document name or path is not valid. Try one or more of the following: * Check the path to make sure it was typed correctly. * On the File menu, click Open. Search for the file using this dialog box. (C:\TestCases\a.doc)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The document name or path is not valid. Try one or more of the following: * Check the path to make sure it was typed correctly. * On the File menu, click Open. Search for the file using this dialog box. (C:\TestCases\a.doc)
=================================================
this my code
Dim DocFormatFile As Object
DocFormatFile = oFile.PostedFile.FileName
Dim oWord As Word.ApplicationClass
Dim oDoc As Word.DocumentClass
Const wdFormatText = 2
Dim tempFileName As Object = "c:\temp.txt"
'create a temp file path
Dim tempFile1 As Object = (tempFileName)
oWord = New Word.ApplicationClass
oDoc = New Word.DocumentClass
oWord = CreateObject("Word.application")
oDoc = CreateObject("Word.document")
'Open uploaded file
oDoc = oWord.Documents.Open(DocFormatFile)
oDoc.SaveAs(tempFile1, wdFormatText)
oDoc.Close()
oWord.Quit()
oDoc = Nothing
oWord = Nothing
=========================================
anyone can help...?
thanks
my program work fine while running on my localhost
but when it goes to server this app not working and give me error like this
=============================================
The document name or path is not valid. Try one or more of the following: * Check the path to make sure it was typed correctly. * On the File menu, click Open. Search for the file using this dialog box. (C:\TestCases\a.doc)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The document name or path is not valid. Try one or more of the following: * Check the path to make sure it was typed correctly. * On the File menu, click Open. Search for the file using this dialog box. (C:\TestCases\a.doc)
=================================================
this my code
Dim DocFormatFile As Object
DocFormatFile = oFile.PostedFile.FileName
Dim oWord As Word.ApplicationClass
Dim oDoc As Word.DocumentClass
Const wdFormatText = 2
Dim tempFileName As Object = "c:\temp.txt"
'create a temp file path
Dim tempFile1 As Object = (tempFileName)
oWord = New Word.ApplicationClass
oDoc = New Word.DocumentClass
oWord = CreateObject("Word.application")
oDoc = CreateObject("Word.document")
'Open uploaded file
oDoc = oWord.Documents.Open(DocFormatFile)
oDoc.SaveAs(tempFile1, wdFormatText)
oDoc.Close()
oWord.Quit()
oDoc = Nothing
oWord = Nothing
=========================================
anyone can help...?
thanks