Abundant Technologies - IT Consulting Experts

 Source Code Library

 Code Details

 
'This module is designed to spell check text boxes on forms. Public Sub spell_check_me(Form_Name As Form, Box_Name As String) Dim WB As Object Dim OldText As String Dim NewText As String Dim i As Integer Dim CH As String * 1 NewText = "" On Error Resume Next Set WB = CreateObject("Word.Basic") If Err Then MsgBox Error$ Exit Sub End If WB.FileNew WB.Insert Form_Name(Box_Name).Text WB.ToolsSpelling WB.EditSelectAll OldText = WB.selection() WB.FileExit 2 For i = 1 To Len(OldText) CH = Mid$(OldText, i, 1) NewText = NewText + CH If CH = Chr$(13) Then NewText = NewText + Chr$(10) Next i Form_Name(Box_Name).Text = NewText End Sub

Mail To: info@3pc.com