Hi i'm busy with a application. This application is a batch of word documents needs to be opend and save it as a clean txt document. So I can open it in Richtextbox. But the problem is when I reach number 678 (something in this range) I get the problem that hole te application crash and vb.net gives no error. Even Try..catch..Endtry will not work.
Here's my code:
Is there any solution to this problem?
Here's my code:
VB.NET:
Private TextK As New TextKernel()
Private Wordapp As New Word.Application()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim miss As Object = System.Reflection.Missing.Value
Dim objTrue As Object = True
Dim objFalse As Object = False
Dim errCount As Integer
Dim i As Integer
Dim doc As Word.Document
For i = 0 To ListBox1.Items.Count - 1
If ListBox1.Items(i).ToString.ToLower.Contains("cv") Then
Try
Me.Text = "Status: " & i & "/" & ListBox1.Items.Count - 1 & " Errors : " & errCount
doc = Wordapp.Documents.Open(ListBox1.Items(i).ToString)
IO.File.Delete("c:\temp.txt")
doc.SaveAs("C:\temp.txt", Word.WdSaveFormat.wdFormatText)
doc.Close()
RichTextBox1.LoadFile("C:\temp.txt", RichTextBoxStreamType.PlainText)
Dim dat As TextKernel.GetDatafromFile = TextK.ExtractDatafromFile(ListBox1.Items(i).ToString)
Dim dat2 As TextKernel.GetDatafromstring = TextK.ExtractDatafromstring(RichTextBox1.Text)
RichTextBox2.Text = RichTextBox2.Text & dat.Voornaam & Chr(9) & dat.Tussenvoegsels & Chr(9) & dat.Achternaam _
& Chr(9) & dat2.Telefoon & Chr(9) & dat2.Geslacht & Chr(9) & dat2.Geboortedatum & Chr(9) & dat2.Email & Chr(10)
Application.DoEvents()
Catch
errCount = errCount + 1
End Try
End If
Application.DoEvents()
Next
MsgBox("Batch is compleet errors: " & errCount)
End Sub
Is there any solution to this problem?
Last edited by a moderator: