Hi, can anyone help me. I've trying to display existing word document in vb.net but i keep getting this error:
D:\System-new\DLIMS\PSM2\FormUserGuideWord.vb(58): Type 'COMExceptionMessageBox.Show' is not defined.
I have add reference (Microsoft word 11.0 because im using ms word 2003) to my project but i still cannot display the word document.
Below is the code that i write to open word document in vb.net 2003:
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Interop.Word
Public Class FormUserGuideWord
Inherits System.Windows.Forms.Form
Private Sub FormUserGuideWord_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strFileName As String
Dim word As New Microsoft.Office.Interop.Word.Application
Dim doc As Microsoft.Office.Interop.Word.Document
Try
doc = Word.Documents.Open("D:\System\DLIMS\UserGuide.doc")doc.Activate()
Catch ex As COMExceptionMessageBox.Show("Error accessing Word document.")
End Try
End Sub
End Class
Hopefully someone can help me to solve my problem. TQ.