Spell Check on Data Entry

Jkittle

Registered User.
Local time
Today, 08:56
Joined
Sep 25, 2007
Messages
100
I have a data entry memo field on a form and I want to add a spell check feature, how is this accomplished?
 
check the samples or code - some smart bunny has already done this ...
 
Thanks Gary, I finally found some code here that I was able to get working
 
if you can post it here - makes it easier for others to look for -
 
Here what I used for my field.

Private Sub permanentaction_Exit(Cancel As Integer)
Dim strSpell
strSpell = permanentaction
If IsNull(Len(strSpell)) Or Len(strSpell) = 0 Then
Exit Sub
End If
With permanentaction
.SetFocus
.SelStart = 0
.SelLength = Len(strSpell)
End With
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
End Sub

Just change the "permanentaction" to the name of the field your want to spell check or add more line for multiple fields.
 
Simple Software Solutions

Hi

There is a way of building in the spell checker found in Word.

On the KeyDown event of the memo field enter the following

Private Sub TxtTxt_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 118 Then 'F7 Function Key
Me.TxtTxt.Text = SpellChecker(Me.TxtTxt.Text)
End If
End Sub

Function SpellChecker(Optional AnyText As String) As String
'Author :David Crake
'Version :1.5
'Version date :19/04/07

'*********************************************************************************************
'This simple function uses the spell check functionality of Microsoft Word
'When the user presses F7 within the text control this function is called
'The spell checker will appear as it would in Word.
'A new document is created and the incoming text is passed to it - if valid
'Then the spell checker is run against the text and appropriate actions taken - user defined
'The results of these actions are then passed back to the return parameter of this function
'*********************************************************************************************

Dim StrTextIn As String
Dim StrTextOut As String
Dim objword As Object 'create word object variable

'Test for invalid contents

If IsEmpty(AnyText) Or IsNumeric(AnyText) Then
SpellChecker = AnyText
Exit Function
End If


StrTextIn = AnyText

Set objword = CreateObject("Word.Application") 'Create Word instance
With objword 'Use instance
.Visible = False 'Hide Word
.Documents.Add 'Open a new document
.Selection.Text = StrTextIn 'Copy incoming text to then new document
.ActiveDocument.CheckSpelling 'Run the spell Check
StrTextOut = .Selection.Text 'Copy Results back
.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges 'Don't save doc
.Quit 'Exit Word
End With 'End the usage

Set objword = Nothing 'Release Object Variable

SpellChecker = StrTextOut 'Return the results to the calling control

End Function


Code Master:cool:
 

Users who are viewing this thread

Back
Top Bottom