This Agent changes the NOTES.INI variable responsible for the spellchecker language (SPELL_LANG).
You have to set up a shared agent, which is called manually from the actions menu (run once (@Commands may be used)). Because I use this agent for several languages this agents exists several times in my mail database. As name I recommand something hierarchical (DictionarySet English - UK) so you can build your own menu for the dictionaries you will use.
As you can see I have set up agents for English (UK), English (USA), French, Italian, German (Standard) and German (Reform).
Declarations: %INCLUDE "lsconst.lss"
Dim s As New NotesSession
Dim sDictionary As String
Dim boxType As Long, ret As Integer
Dim sTempString As String
Dim sDir As String, iFile As Integer
Dim FileName As String
On Error Goto Errhandle
boxType& = MB_YESNO + MB_ICONQUESTION
sDictionary = s.GetEnvironmentString( "SPELL_LANG", True )
Select Case sDictionary
Case "1031" :
sTempString = "German (Standard)"
sTempString = "English (USA)"
sTempString = "French"
sTempString = "Italiano"
sTempString = "English (UK)"
sTempString = "German (Reform)"
Case Else :
sTempString = "unknown"
ret% = Messagebox("The active dictionary is: " & sTempString, boxType&, "Continue?")
If ret = 6 Then
sDir$ = s.GetEnvironmentString( "Directory", True )
iFile% = Freefile()
FileName$ = "uk.dic"
Open FileName$ For Input As iFile%
Call s.SetEnvironmentVar( "SPELL_LANG", "2057", True )
Msgbox "You now have changed the spelling dictionary to English (UK)", 0+64, "Dictionary"
Select Case Err
Case 101 :
Msgbox "The selected dictionary 'uk.dic' wasn't found in your NotesData", 0+64, "Error"
Case Else :
Messagebox "Error" & Str(Err) & ": " & Error$