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"
Sub Initialize
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)"
Case "1033":
sTempString = "English (USA)"
Case "1036":
sTempString = "French"
Case "1040":
sTempString = "Italiano"
Case "2057":
sTempString = "English (UK)"
Case "32775":
sTempString = "German (Reform)"
Case Else :
sTempString = "unknown"
End Select
ret% = Messagebox("The
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
If ret = 6 Then
sDir$ = s.GetEnvironmentString( "Directory", True )
Chdir sDir$
iFile% = Freefile()
FileName$ = "uk.dic"
Open FileName$ For Input As iFile%
Close iFile%
Call s.SetEnvironmentVar( "SPELL_LANG", "2057", True )
Msgbox "You now have changed the spelling dictionary to English (UK)", 0+64, "Dictionary"
Else
Exit Sub
End If
Exit Sub
Errhandle:
Select Case Err
Case 101 :
Msgbox "The selected dictionary 'uk.dic' wasn't found in your NotesData", 0+64, "Error"
Exit Sub
Case Else :
Messagebox "Error" & Str(Err) & ": " & Error$
Exit Sub
End Select
End Sub
This was first published in March 2001