M
MSNEWS
I'm having problems using the word.applicationclass to load a word document.
I've created this very simple code and I get the error below on the
WordApp.Documents.Open("C:\temp\worddocs\1.doc", 0, 1) line.
An unhandled exception of type 'System.Runtime.InteropServices.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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim WordApp As New Word.ApplicationClass
Dim contentsofword As String
WordApp.Documents.Open("C:\temp\worddocs\1.doc", 0, 1)
WordApp.Selection.WholeStory()
contentsofword = WordApp.Selection.Text
WordApp.ActiveDocument.Close()
End Sub
I've created this very simple code and I get the error below on the
WordApp.Documents.Open("C:\temp\worddocs\1.doc", 0, 1) line.
An unhandled exception of type 'System.Runtime.InteropServices.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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim WordApp As New Word.ApplicationClass
Dim contentsofword As String
WordApp.Documents.Open("C:\temp\worddocs\1.doc", 0, 1)
WordApp.Selection.WholeStory()
contentsofword = WordApp.Selection.Text
WordApp.ActiveDocument.Close()
End Sub