'************************************** ' Name: A Better SpellChecker ' Description:This is basically an enhan ' ced version of the SpellCheck function t ' hat I found in MSDN from Microsoft. They ' left out a couple things. ' By: Cierra Computers & Consulting (fro ' m psc cd) ' ' ' Inputs:Text ' ' Returns:Text ' 'Assumes:Be sure to Reference the MS Wor ' d Object Library ' 'Side Effects:None '************************************** Public Function SpellCheck(strText As String, Optional blnSupressMsg As Boolean = False) As String 'This function opens the MS Word Object ' and uses its spell checker 'passing back the corrected string On Error Resume Next Dim oWDBasic As Object Dim sTmpString As String If strText = "" Then If blnSupressMsg = False Then MsgBox "Nothing to spell check.", vbInformation, App.ProductName End If Exit Function End If Screen.MousePointer = vbHourglass Set oWDBasic = CreateObject("Word.Basic") With oWDBasic .FileNew .Insert strText .ToolsSpelling oWDBasic.EditSelectAll .SetDocumentVar "MyVar", oWDBasic.Selection End With sTmpString = oWDBasic.GetDocumentVar("MyVar") sTmpString = Left(sTmpString, Len(sTmpString) - 1) If sTmpString = "" Then SpellCheck = strText Else SpellCheck = sTmpString End If oWDBasic.FileCloseAll 2 oWDBasic.AppClose Set oWDBasic = Nothing Screen.MousePointer = vbNormal If blnSupressMsg = False Then MsgBox "Spell check is completed.", vbInformation, App.ProductName End If End Function