SmartIcon to run Spell Language and Spellcheck in one step

This functionality allows you to set the SpellLanguage and run the SpellChecker in one step. First answer the question with your language (keep in mind that the language.dic has to be installed) and wait for your spelling results.

- create a SmartIcon with Formula
- create an SharedAgent/Runonce/Script
- paste Code and modify your favorites

Sub Initialize
	On Error Goto Errhandle
	Dim s As New NotesSession
	Dim workspace As New NotesUIWorkspace
	Dim uidoc As NotesUIDocument
	Dim num As Integer			
	Dim latestNumber As String
	Dim Title As String
	Dim old As Integer
	latestNumber = s.GetEnvironmentString( "SPELL_LANG", True )	
	Select Case latestNumber
	Case "1031": 
		Title = "German (Standard)" ' German (Standard)
		old = 1
	Case "32775": 
		Title = "German (Reform)" ' German (Reform)
		old = 2
	Case "1033": 
		Title = "Englisch US" ' English US
		old = 3
	Case "2057": 
		Title = "English GB" ' English GB
		old = 4
	Case Else : Title = "Language not known." 		
	End Select				
	num% = Cint(Inputbox$(_
	"1 = German (Standard) " &"2 = German (Reform)" & Chr(10)&_
	"3 = English (US)                       " &"4 = English (GB)" &
Chr(10),Title,old, 1,1))
	Select Case Num		
	Case 1: s.SetEnvironmentVar "SPELL_LANG", "1031", True ' DE alte
	Case 2: s.SetEnvironmentVar "SPELL_LANG", "32775", True ' DE neue
	Case 3: s.SetEnvironmentVar "SPELL_LANG", "1033", True ' Englisch US
	Case 4: s.SetEnvironmentVar "SPELL_LANG", "2057", True ' Englisch GB
	Case Else : Msgbox "Wrong Input. Active Directory is used. " 
	End Select			
	Set uidoc = workspace.CurrentDocument   
	Call uidoc.SpellCheck()		
	Exit Sub	
	Messagebox "Error" & Str(Err) & ": " & Error$
	Msgbox "No Input. SpellCheck aborded." 
	Exit Sub
End Sub

This was first published in July 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.