Spell Check

M

Martin

Hello,

Is there any way of programatically spell checking an unbound text box
without checking the remaining fields / form?

I haven't written the code yet but was going to use domenuitem to get to the
spell checker.

Martin
 
B

biganthony via AccessMonster.com

Martin,

This is what I do:

In the Tag property of the text boxes I want spell-checked, I put the Value
of True.
I add a command button to the form and the code for the onclick command of
the button is:

Dim ctlSpell As Control
Dim frm As Form

Set frm = Screen.ActiveForm

DoCmd.SetWarnings False

For Each ctlSpell In frm.Controls

If TypeOf ctlSpell Is TextBox Then

If Len(ctlSpell) > 0 Then

With ctlSpell

'only spell check the text boxes with a value of true in
their tag property.
If .Tag = "True" Then

.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)

DoCmd.RunCommand acCmdSpelling

End If

End With

End If

End If

Next

MsgBox "Spell check complete.", vbInformation + vbOKOnly, "Finished."
DoCmd.SetWarnings True

I found code similar to this on the forum some time ago but cannot remember
who wrote it. (Would like to know so I can acknowledge them in the code).

Regards
Anthony
 
M

Martin

Anthony,

Thanks for this, it works perfectly and adds a great function to my form.

I too would like to acknowledge them, if I ever find it I will update this
thread.

Thank you for your help.

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top