Spelling isn't available now

M

macroapa

Hi,

I have a form with 2 text boxes and have a button on it to perform
spell checking. My code for the button is below, but it doesn't run
and fails with the message 'Spelling' isn't available now.

Any ideas on where I have gone wrong (the standard spelling macro
fails as well, but i can run toolbar spell check in a field in a
table).

Thanks

Dim ctlSpell As Control
Dim frm As Form
Set frm = Screen.ActiveForm
DoCmd.SetWarnings False
' Enumerate Controls collection.
For Each ctlSpell In frm.Controls
If TypeOf ctlSpell Is TextBox Then
If Len(ctlSpell) > 0 Then
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
End With
DoCmd.RunCommand acCmdSpelling
End If
End If
Next
DoCmd.SetWarnings True
 

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