I have this VBA function: when I exit a field, it launches the spell checker automatically. However I have fields in English and others in French, so I am looking for a way to set the Dictionnary language for each field so that Access knows which dictionnary/grammar checker to use.
So for instance how would you include the French language in this code?
Private Sub Field_Exit(Cancel As Integer)
Dim strSpell
strSpell = Field
If IsNull(Len(strSpell)) Or Len(strSpell) = 0 Then
Exit Sub
End If
With Field
.SetFocus
.SelStart = 0
.SelLength = Len(strSpell)
End With
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
End Sub
Trawling the internet came up with this:
Application.SetOption "Spelling dictionary language", xxxx
where xxxx is one of the constants listed here: http://msdn.microsoft.com/en-us/library/aa432635%28v=office.12%29.aspx
Should be able to flip the switch back and forth when you need to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With