Spell Check Capitals

  • Thread starter Charles D Clayton Jr
  • Start date
C

Charles D Clayton Jr

Does anybody know how to spell check capitals? I have used the code
DoCmd.RunCommand acCmdSpelling which works but not on capitals.
I know that you can physically go in to the spelling dialog box and
set the option but can you do this through code? Or can you check to
see if a user's options are already set and let them know that it will
not work for capitals?

Thanks,

Charles D Clayton Jr
 
D

Dirk Goldgar

Charles D Clayton Jr said:
Does anybody know how to spell check capitals? I have used the code
DoCmd.RunCommand acCmdSpelling which works but not on capitals.
I know that you can physically go in to the spelling dialog box and
set the option but can you do this through code? Or can you check to
see if a user's options are already set and let them know that it will
not work for capitals?

Thanks,

Charles D Clayton Jr

See the help file entries for the GetOption and SetOption methods of the
Application object. You can check this option with code like this:

If Application.GetOption("Spelling Ignore words in UPPERCASE") = 0 _
Then
MsgBox "Note: words in upper case will not be checked!"
End If

I suppose you could do something like the following, but I'd be very
wary of it:

Dim fSpellcheckUppercase As Boolean

fSpellcheckUppercase = _
Application.GetOption("Spelling Ignore words in UPPERCASE")

If Not fSpellcheckUppercase Then
Application.SetOption "Spelling Ignore words in UPPERCASE", True
End If

' ... do your spell check here ...

If Not fSpellcheckUppercase Then
Application.SetOption "Spelling Ignore words in UPPERCASE",
False
End If

You'd want to set up error-handling to ensure that, if you changed the
user's option, there's no way the code can exit without resetting it to
the original value. I don't recommend this approach at all, though,
because something could always happen -- a crash perhaps -- that would
leave the user's option set incorrectly. You don't want to go monkeying
around with users' preferences without their permission.
 
C

Charles D Clayton Jr

Thasnks for the good information. Sometimes it can be very difficult
to find something in the Help System if you do not know it exists.

Charles D Clayton Jr
 
Top