B
Bjørn
I try to acccess the office toolkit with code such as:
Dim wordDocument As Microsoft.Office.Interop.Word.Document = Nothing
Try
wordDocument = wordApplication.Documents.Open(FileId)
If Not wordDocument Is Nothing Then
Dim path As String = AdjustExt(FileId, ".doc")
If File.Exists(path) Then File.Delete(path)
wordDocument.SaveAs(path, WdSaveFormat.wdFormatDocument) '
wordformat 2003
Else
Return "Error: Word document " & FileId & " not found"
End If
Catch ex As Exception
Return ex.Message
Finally
If Not wordDocument Is Nothing Then
wordDocument.Close(False)
wordDocument = Nothing
End If
If Not wordApplication Is Nothing Then
wordApplication.Quit()
wordApplication = Nothing
End If
End Try
This function as a dream on my development computer, but gives the following
error while being deployed to server.
"Retrieving the COM class factory for component with CLSID
{000209FF-0000-0000-C000-000000000046} failed due to the following error:
80040154"
The webfiles has been published to localhost, and then copied to the
server's inetpub\wwwroot, while the following dll's has been deployed by a
webSetup project (with register = vsdpaDefault) to the bin-directory of the
webfiles:
Microsoft.Office.Interop.Word.dll
Microsoft.Vbe.Interop.dll
office.dll
Microsoft office is not installed on the server, but the wordfiles are
generated on server (system.xml), and are meant to be edited in word by the
users after this "saveAs" in old format..
Hope that anyone has a suggestion how to solve my problem.
Dim wordDocument As Microsoft.Office.Interop.Word.Document = Nothing
Try
wordDocument = wordApplication.Documents.Open(FileId)
If Not wordDocument Is Nothing Then
Dim path As String = AdjustExt(FileId, ".doc")
If File.Exists(path) Then File.Delete(path)
wordDocument.SaveAs(path, WdSaveFormat.wdFormatDocument) '
wordformat 2003
Else
Return "Error: Word document " & FileId & " not found"
End If
Catch ex As Exception
Return ex.Message
Finally
If Not wordDocument Is Nothing Then
wordDocument.Close(False)
wordDocument = Nothing
End If
If Not wordApplication Is Nothing Then
wordApplication.Quit()
wordApplication = Nothing
End If
End Try
This function as a dream on my development computer, but gives the following
error while being deployed to server.
"Retrieving the COM class factory for component with CLSID
{000209FF-0000-0000-C000-000000000046} failed due to the following error:
80040154"
The webfiles has been published to localhost, and then copied to the
server's inetpub\wwwroot, while the following dll's has been deployed by a
webSetup project (with register = vsdpaDefault) to the bin-directory of the
webfiles:
Microsoft.Office.Interop.Word.dll
Microsoft.Vbe.Interop.dll
office.dll
Microsoft office is not installed on the server, but the wordfiles are
generated on server (system.xml), and are meant to be edited in word by the
users after this "saveAs" in old format..
Hope that anyone has a suggestion how to solve my problem.