Link to home
Start Free TrialLog in
Avatar of Wojciech Duda
Wojciech Duda

asked on

Outlook 2000 macro for spell check language change needed

I need a macro (also if I could assign a button in Outlook for it) that would go to "Tools", "ABC - Spelling" then select "Options" and from within here choose the language for the email spell check, so I can change the setting between German and English (or pehaps choose the language as I might add other languages into the mix). Would be great if the button would show an abbreviation of the language selected. Can someone help?
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wojciech Duda
Wojciech Duda

ASKER

Thank, I'll have to learn a bit about using macros and then I can try and use your example. Sorry about not answering I have access to EE only at work and I fell ill the last two weeks.
Hi, mcwojtekk.

No problem about not answering and I'm sorry to hear you were ill.  I hope you're feeling better.  Here's what you need to do to use the macro.  Sorry I didn't post these earlier.

1.  Open Outlook.
2.  Click Tools->Macro->Visual Basic Editor.
3.  If it's not already expanded, expand Modules and click on Module1.
4.  Copy the code I posted and paste it into the right-hand pane of the Visual Basic Editor.
5.  Click the diskette icon to save the change.
6.  Exit the Visual Basic Editor.
7.  Click Tools->Macro->Security.
8.  Change the Security Level to Medium.

To use the macro click Tools->Macro->Macros, select ChangeSpeller from the list of macros, and click Run.  If you plan to use the amcro a lot, then you can add an additional toolbar for macros and place a shortcut to this macro on it.

Hope that helps.
Thanks, I have modified this for my German UI:

Sub EnglishSpellCheck()
    SendKeys "%X"
    SendKeys "O"
    SendKeys "^({TAB}{TAB}{TAB})"
    SendKeys "%S"
    SendKeys "Englisch {(}USA{)}"
    SendKeys "{ENTER}"
End Sub

Sub GermanSpellCheck()
    SendKeys "%X"
    SendKeys "O"
    SendKeys "^({TAB}{TAB}{TAB})"
    SendKeys "%S"
    SendKeys "Deutsch {(}Deutschland{)}"
     SendKeys "{ENTER}"
End Sub


Thanks a lot!
You're welcome.
Dear BlueDevilFan:

I tried your macro out, but regrettably it is not working. There is no switching of the spell  check language. I am aware that "mcwojtekk", the guy who originally posted the question, was happy with what he got from you. So, it should be working.

I guess it has something to do that I work with Outlook 2003?

Anyway, I happen to find a code that allows me to switch between French, German and English. I assigned these macros to toolbar buttons. And they are running fine. Please see below.

I am still interested in your helping me with your original code to get it running, siince I would like to award you the points you deserve.

Regards, Andreas
Public Sub SetGermanSpelling()
 
    ' Deutsche Rechtschreibprüfung einstellen
 
    Call SetSpelling("Deutsch")
 
End Sub
 
 
 
Public Sub SetEnglishSpelling()
 
    ' Englische Rechtschreibprüfung einstellen
 
    Call SetSpelling("Englisch")
 
End Sub
 
 
 
Public Sub SetFrenchSpelling()
 
    ' Französische Rechtschreibprüfung einstellen
 
    Call SetSpelling("Französisch")
 
End Sub
 
 
 
Private Sub SetSpelling(ByVal strLanguage As String)
 
 
 
    '=====================================================================
 
    ' Schaltet die Rechtschreibprüfung per Mausklick um.
 
    ' Funktioniert nur bis Outlook 2003
 
    ' (c) Peter Marchert - http://www.outlook-stuff.com
 
    ' 2008-11-12 Version 1.0.0
 
    '=====================================================================
 
 
 
    Dim strVer As String        ' Outlook®-Version
 
    Dim strRegKey As String     ' Schlüssel für die Rechtschreibprüfung
 
    Dim blnResult As Boolean    ' Umstellung erfolgreich
 
 
 
    '---------------------------------------------------------------------
 
    ' Outlook®-Version ermitteln
 
    '---------------------------------------------------------------------
 
    Select Case Left(Outlook.Version, 2)
 
        Case "9.": strVer = "9.0"    ' Outlook® 2000
 
        Case "10": strVer = "10.0"   ' Outlook® 2002
 
        Case "11": strVer = "11.0"   ' Outlook® 2003
 
    End Select
 
 
 
    '---------------------------------------------------------------------
 
    ' Registrierungsschlüssel zusammensetzen
 
    '---------------------------------------------------------------------
 
    strRegKey = "HKCU\Software\Microsoft\Office\" & strVer & "\Outlook\Options\Spelling\Speller"
 
 
 
    '---------------------------------------------------------------------
 
    ' Sprache umschalten
 
    '---------------------------------------------------------------------
 
    Select Case strLanguage
 
        Case "Deutsch"
 
            blnResult = RegWrite(strRegKey, "1031Normal")
 
        Case "Englisch"
 
            blnResult = RegWrite(strRegKey, "1033Normal")
 
        Case "Französisch"
 
            blnResult = RegWrite(strRegKey, "1036Normal")
 
        Case Else
 
            MsgBox "Es ist keine Sprache definiert.", vbCritical + vbOKOnly
 
            Exit Sub
 
    End Select
 
 
 
    '---------------------------------------------------------------------
 
    ' Umschaltung erfolgreich?
 
    '---------------------------------------------------------------------
 
    If blnResult Then
 
        MsgBox "Die Rechtschreibprüfung wurde auf " & strLanguage & _
            " umgestellt.", vbInformation + vbOKOnly
 
    Else
 
        MsgBox "Die Rechtschreibprüfung konnte nicht auf " & strLanguage & _
            " umgestellt werden.", vbCritical + vbOKOnly
 
    End If
 
 
 
End Sub
 
 
 
Private Function RegWrite(ByVal strKey As String, ByVal varValue As Variant) As Boolean
 
 
 
    '=====================================================================
 
    ' Schreibt Daten in die Registrierung
 
    ' 2008-11-12 Version 1.0.0
 
    '=====================================================================
 
 
 
    Dim objWsh As Object
 
 
 
    On Error Resume Next
 
 
 
    '---------------------------------------------------------------------
 
    ' Windows Script Host instanzieren
 
    '---------------------------------------------------------------------
 
    Set objWsh = CreateObject("WScript.Shell")
 
 
 
    '---------------------------------------------------------------------
 
    ' Daten in Registrierung schreiben
 
    '---------------------------------------------------------------------
 
    Call objWsh.RegWrite(strKey, varValue)
 
 
 
    '---------------------------------------------------------------------
 
    ' Prüfen, ob Wert geschrieben wurde
 
    '---------------------------------------------------------------------
 
    If RegRead(strKey) = varValue Then RegWrite = True
 
 
 
    '---------------------------------------------------------------------
 
    ' Clean Up
 
    '---------------------------------------------------------------------
 
    Set objWsh = Nothing
 
 
 
End Function
 
 
 
Private Function RegRead(ByVal strKey As String) As Variant
 
 
 
    '=====================================================================
 
    ' Liest Daten aus der Registrierung
 
    ' 2008-11-12 Version 1.0.0
 
    '=====================================================================
 
 
 
    Dim objWsh As Object
 
 
 
    On Error Resume Next
 
 
 
    '---------------------------------------------------------------------
 
    ' Windows Script Host instanzieren
 
    '---------------------------------------------------------------------
 
    Set objWsh = CreateObject("WScript.Shell")
 
 
 
    '---------------------------------------------------------------------
 
    ' Daten aus Registrierung lesen und zurückgeben
 
    '---------------------------------------------------------------------
 
    RegRead = objWsh.RegRead(strKey)
 
 
 
    '---------------------------------------------------------------------
 
    ' Clean Up
 
    '---------------------------------------------------------------------
 
    Set objWsh = Nothing
 
 
 
End Function

Open in new window

Andreas,

Please post to your question, not this one.