UNKNOWN '************************************** ' Name: Spell Checker (uses MS Word) ' Description:This code uses OLE Automat ' ion to allow VB to open an instance of M ' S Word if the user has it on their syste ' m and spell check the contents of a text ' box. It could easily be modified to work ' with any control that has text on it. I ' would recommend better error control tha ' n the On Error statement listed here. ' By: T. Heinel ' ' ' Inputs:None ' ' Returns:The code automatically replace ' s the original text of the message box w ' ith the corrected text. ' 'Assumes:Just create the text box and co ' mmand button listed in the code. ' 'Side Effects:None 'This code is copyrighted and has limite ' d warranties. 'Please see http://www.Planet-Source-Cod ' e.com/xq/ASP/txtCodeId.1904/lngWId.1/qx/ ' vb/scripts/ShowCode.htm 'for details. '************************************** Private Sub cmdSpellCheck_Click() 'On Error Resume Next 'Best to un-commen ' t this while testing Dim objMsWord As Word.Application Dim strTemp As String Set objMsWord = CreateObject("Word.Application") objMsWord.WordBasic.FileNew objMsWord.WordBasic.Insert txtMessage.Text objMsWord.WordBasic.ToolsSpelling objMsWord.WordBasic.EditSelectAll objMsWord.WordBasic.SetDocumentVar "MyVar", objMsWord.WordBasic.Selection objMsWord.Visible = False ' Mostly prevents Word from being shown strTemp = objMsWord.WordBasic.GetDocumentVar("MyVar") txtMessage.Text = Left(strTemp, Len(strTemp) - 1) objMsWord.Documents.Close (0) ' Close file without saving objMsWord.Quit ' Exit Word Set objMsWord = Nothing' Clear object memory frmMain.SetFocus' Return focus to Main form End Sub