Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

VS 2010 [RESOLVED] Visual Basic Microsoft Word Spell Checker.

$
0
0
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

Viewing all articles
Browse latest Browse all 27349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>