I'm having problems using the word.applicatio nclass to load a word document.
I've created this very simple code and I get the error below on the
WordApp.Documen ts.Open("C:\tem p\worddocs\1.do c", 0, 1) line.
An unhandled exception of type 'System.Runtime .InteropService s.COMException'
occurred in test.exe
Additional information: There is insufficient memory. Save the document now.
This is my full code!
Please help, this is getting annoying.
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim WordApp As New Word.Applicatio nClass
Dim contentsofword As String
WordApp.Documen ts.Open("C:\tem p\worddocs\1.do c", 0, 1)
WordApp.Selecti on.WholeStory()
contentsofword = WordApp.Selecti on.Text
WordApp.ActiveD ocument.Close()
End Sub
I've created this very simple code and I get the error below on the
WordApp.Documen ts.Open("C:\tem p\worddocs\1.do c", 0, 1) line.
An unhandled exception of type 'System.Runtime .InteropService s.COMException'
occurred in test.exe
Additional information: There is insufficient memory. Save the document now.
This is my full code!
Please help, this is getting annoying.
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim WordApp As New Word.Applicatio nClass
Dim contentsofword As String
WordApp.Documen ts.Open("C:\tem p\worddocs\1.do c", 0, 1)
WordApp.Selecti on.WholeStory()
contentsofword = WordApp.Selecti on.Text
WordApp.ActiveD ocument.Close()
End Sub