Change Spelling Dictionary from Menu

Change Spelling Dictionary from Menu

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.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

active dictionary is: " & sTempString, boxType&, "Continue?")
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

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.