Microsoft & .NETVisual BasicVB Coding Tip: Use the Spell Checker

VB Coding Tip: Use the Spell Checker content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Use Microsoft Word to spell check your work.

Public Function SpellCheck _
     (ByVal IncorrectText$) As String

Dim Word As Object, retText$

On Error Resume Next

Set Word = CreateObject("Word.Basic")

Word.Insert IncorrectText

retText = Word.Selection$()
SpellCheck = Left$( retText, _
                    Len(retText) - 1)
Word.FileClose 2


Set Word = Nothing

End Function
Private Sub cmdSpellCheck_Click()
Text1 = SpellCheck(Text1)
End Sub

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories