Avatar billede hermann1 Nybegynder
23. januar 2001 - 09:40 Der er 4 kommentarer og
1 løsning

Smarticon Formula til skift af stavekontrol ønskes.

For at skifte stavekontrol sprog f. eks. Engelsk/Dansk skal man i Lotus Notes 5.0.5 igennem en lang mængde steps: File, Preferences, User Preferences, International, Change Spell Dictonary; først derefter kan man skifte stavekontrol sprog. Jeg har skrevet en Smarticon Formula der kan bringe mig noget af vejen til at skifte stavekontrol sprog: @Command([ToolsSetupUserSetup]). Denne bringer mig kun til User Preferences i et hop. Hvordan kan Smarticon Formula udbygges så jeg kommer helt hen til og ind i Change Spell Check Dictonaries??? Jørgen H.L.
23. januar 2001 - 11:08 #1
Taget fra Technote EMN3HKCKG i Lotus Notes Knowledge Base

How To Create a SmartIcon To Switch to a Different Language Spell Checker

Problem:
How do you create a SmartIcon to switch to a Spell Checker for a different language?

Solution:

Follow these steps:

1. Create or use two existing SmartIcons that represent two different languages.  In this scenario, the desired end result is to create two SmartIcons:  one for English, and one for French.

Notes 4.x: Select File, Tools, SmartIcons.  Select any two unused icons from the Available Icons list and drag them to the list of icons that are currently being used on the right.  If you want to create your own custom SmartIcons, refer to the document, \"Customizing SmartIcons in Notes Using Microsoft Windows\' Paintbrush\" (#111756).

Notes 5.x: Select File, Preferences, SmartIcon Settings.  Drag any two unused icons over to the list of icons that are currently being used on the right.

2. Click one of these icons in the right hand list, and select Edit Icon.  Add a Description such as ENGLISH and then click the Formula button.  In the Formula dialog box, insert the following formula:

@Command([FileSave]);
@Command([ToolsRunMacro];\"English Spell Check\");
@PostedCommand([ToolsSpellCheck])

3. Click OK, then Done, then OK to close all dialog boxes.  Repeat this procedure to create a SmartIcon for any other language you desire.  In this example, repeat the procedure once to create a second icon for the French Spell Checker.  Be sure to change the name of the Agent in the second line of your formula to \"French Spell Check\".  Also, be careful to start the last line with @PostedCommand.  This is to retain execution order.

@Command([FileSave]);
@Command([ToolsRunMacro];\"French Spell Check\");
@PostedCommand([ToolsSpellCheck])

4. Select your mail file and select View, Agents.  (In Notes R5, performing this step will launch Domino R5 Designer if it is installed on your computer.)

5. Select Create, Agent.

6. Call the agent \"English Spell Check\" or whatever you called it in Step 2.  This agent should run \"Manually from Actions Menu\" and in the drop down box entitled \"Which documents should it act on?\", be sure to select \"Run Once  @Commands may be used\".

7. Choose LotusScript for the radio button choice of \"What should this agent run?\".

8. For Notes 4.x users, in the Event drop down box, select Initialize.  Input the following LotusScript code:

Dim sess As New NotesSession
sess.SetEnvironmentVar \"SPELL_LANG\", 1, True

This will set the spelling language to American English.

Create a second agent called \"French Spell Check\" and input the following LotusScript code:

Dim sess As New NotesSession
sess.SetEnvironmentVar \"SPELL_LANG\", 3, True

This will set the spelling language to French Standard.  Any language can be used by simply manually selecting the desired language under File, Tools, User Preferences, and making note of the number assigned to the SPELL_LANG variable in the Notes.ini.  Whatever this number becomes, substitute that number for the number 3 in the above script.

For Notes 5.x users, you will be able to add an agent only if you have the R5 Designer Client installed.  If you do, after you select View, Agents, select \'New Agent\'.  Make the same selections as the 4.x user, and then select LotusScript.  Click on Initialize, and type in:

Dim sess As New NotesSession
sess.SetEnvironmentVar \"SPELL_LANG\", 1033, True
sess.SetEnvironmentVar \"Preference_en\",\",,,1033,,,,,,\", True

This will set the spelling language to English - United States.  Any language can be used, but the settings are different than 4.x.  Notes 5.x uses the IBM Spell Checker, and the language numbers do not correspond to the same language numbers in 4.x.  Once again, any language can be used, but you must take note of both the SPELL_LANG Notes.ini parameter, and the PREFERENCE_EN parameter.  The number will be the same for both variables.

Create a second agent called \"French Spell Check\" and input the following code:

Dim sess As New NotesSession
sess.SetEnvironmentVar \"SPELL_LANG\", 1036, True
sess.SetEnvironmentVar \"Preference_en\",\",,,1036,,,,,,\", True

This will set the spelling language to French Standard.

9. Save the script, and open a mail message.  Type in a few words and test your script by clicking on either SmartIcon.  The Spell Checker will always run in the language specified by the SmartIcon.


Note:  This is a database agent, and hence will run in whatever database it is copied into.  It will not run in a database that does not contain the two agents called by the @Command([ToolsRunMacro]) command.  If you attempt to do so, you will see an error message informing you that the agent does not exist, and the spell checker will run in whatever language was last chosen.
Avatar billede hermann1 Nybegynder
23. januar 2001 - 14:29 #2
Som jeg forstår det under punkt 8, skal sproget sættes som 1033 for English - United States og 1036 for French. Spørgsmålet er nu: Hvad er nummer koden for English (United Kingdom) og nummerkoden for Danish?
23. januar 2001 - 14:48 #3
Du kan læse værdierne i notes.ini !
Det er variablen SPELL_LANG

Bemærk at værdien er forskellig fra version 4 til 5 af Notes !
Men for 4.x af notes er det: SPELL_LANG=11
Og for 5.x af notes er det: SPELL_LANG=1030

Mvh. Jeppe
26. januar 2001 - 10:56 #4
Hej Hermann1 - Er du ikke tilfreds med mit svar, er der noget du vil have uddybet eller har du bare glemt at giv mig point ?

Mvh. Jeppe
Avatar billede hermann1 Nybegynder
31. januar 2001 - 17:48 #5
Hej jeppek. Har desværre haft travlt. Har lige taget mig tiden til problemet og jeg har fået det til at virke efter din opskrift på Notes 5.05. Ved at skifte med stavekontrol på \"den gamle måde\" kunne jeg se at UK English er code 2057 & Danish er kode 1030, i filen Notes.ini. Det var slet ikke så svært at installerer via Agents (jeg har Designer Agent installeret). Tak for professionel hjælp. Jørgen H.L.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Computerworld tilbyder specialiserede kurser i database-management

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester