I have an application that i Installed a spell checker in a text box. Everything works fine, but I want the application to be able to check to see if the User has word installed. If not I need want the app to bypass the Spell Checker. Please Help.
Here is the Code:
Private Sub txtNotes_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtNotes.LostFocus
If txtNotes.Text.Length > 0 Then
Dim wordApp As New Word.Application
wordApp.Visible = False
Dim doc As Word.Document = wordApp.Documents.Add()
Dim range As Word.Range
range = doc.Range()
range.Text = txtNotes.Text
doc.Activate()
doc.CheckSpelling()
Dim chars() As Char = {CType(vbCr, Char), CType(vbLf, Char)}
txtNotes.Text = doc.Range().Text.Trim(chars)
doc.Close(SaveChanges:=False)
wordApp.Quit()
End If
End Sub
Private Sub txtNotes_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtNotes.TextChanged
End Sub
Here is the Code:
Private Sub txtNotes_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtNotes.LostFocus
If txtNotes.Text.Length > 0 Then
Dim wordApp As New Word.Application
wordApp.Visible = False
Dim doc As Word.Document = wordApp.Documents.Add()
Dim range As Word.Range
range = doc.Range()
range.Text = txtNotes.Text
doc.Activate()
doc.CheckSpelling()
Dim chars() As Char = {CType(vbCr, Char), CType(vbLf, Char)}
txtNotes.Text = doc.Range().Text.Trim(chars)
doc.Close(SaveChanges:=False)
wordApp.Quit()
End If
End Sub
Private Sub txtNotes_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtNotes.TextChanged
End Sub