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

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 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"
Exit Sub
End If
Exit Sub

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

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

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.