Hi All,
" The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"
I encountered the above message when i try to do the following:
(problem occur at the point where I open existing .doc file)
--------------------------------------------------------
Option Explicit On
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Interop.Word
Public Class frmTest
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim word As New Application
Dim doc As New Document
Dim missing As Object = System.Reflection.Missing.Value
Dim rdonly As Object = False
Dim isVisible As Object = True
Dim fileName As Object = "C:\test.doc"
Try
doc = word.Documents.Open(fileName, missing, rdonly, missing, missing, missing, missing, missing, missing, missing, missing, isVisible)
doc.Activate()
'MORE FORMATTING ACTION TO BE DONE HERE
Catch ex As COMException
msgbox(ex.Message)
End Try
End Sub
End Class
-------------------------------------------------------------
Please let me know if you know how to resolve it. Thanks in advance and appreciate your great help.
" The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"
I encountered the above message when i try to do the following:
(problem occur at the point where I open existing .doc file)
--------------------------------------------------------
Option Explicit On
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Interop.Word
Public Class frmTest
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim word As New Application
Dim doc As New Document
Dim missing As Object = System.Reflection.Missing.Value
Dim rdonly As Object = False
Dim isVisible As Object = True
Dim fileName As Object = "C:\test.doc"
Try
doc = word.Documents.Open(fileName, missing, rdonly, missing, missing, missing, missing, missing, missing, missing, missing, isVisible)
doc.Activate()
'MORE FORMATTING ACTION TO BE DONE HERE
Catch ex As COMException
msgbox(ex.Message)
End Try
End Sub
End Class
-------------------------------------------------------------
Please let me know if you know how to resolve it. Thanks in advance and appreciate your great help.
Last edited: