Consulting

Results 1 to 19 of 19

Thread: Solved: How to change the language of the Spell Checker in Outlook with a macro?

  1. #1
    VBAX Newbie
    Joined
    Jul 2007
    Posts
    5
    Location

    Thumbs down Solved: How to change the language of the Spell Checker in Outlook with a macro?

    Hallo, I wonder if someone can help me. I would like to create a couple of macro to change the language of the Spell Checker in Outlook. I need it because I send many message in different languages and I always perform a spelling check before sending them, but it?s very annoying to have to change the language manually every time.
    Unfortunately, the Spell Checker Engine is not an Object in Outlook, nor the language is a property of other objects (as for example LanguageID in MS Word, being a property of Selection, Range and several other objects).
    Does someone have a useful tip? Thanks in advance!
    Last edited by Aussiebear; 04-20-2023 at 05:42 AM. Reason: Adjusted the font to standard

  2. #2
    VBAX Regular Ebrow's Avatar
    Joined
    May 2007
    Posts
    67
    Location

    Wink mmm Dunno but this might be a clue

    Hi.

    I am not very good at Outlook, however i have had a little look and I can get the code to tell us what language we are using, however I cannot workout how to change that setting. Maybe this may get others thinking.

    MsgBox "Is it US English" & Application.LanguageSettings.LanguagePreferredForEditing(msoLanguageIDEnglishUS)
    &

    MsgBox "Give me the language ID" & Application.LanguageSettings.LanguageID(msoLanguageIDUI)
    Last edited by Aussiebear; 04-20-2023 at 05:43 AM. Reason: Adjusted the code tags
    Nothing is impossible, just it hasn't been thought of yet.

  3. #3
    VBAX Newbie
    Joined
    Jul 2007
    Posts
    5
    Location

    Unhappy

    Thanks a lot Ebrew,

    Unfortunately de properties of LanguageSettings do not affect the Spelling Checker but only the User Interfaces, the Install Language etc.
    The LanguagePreferredForEditing property is a predefined register setting, which cannot be changed and is therefore read-only.
    As a matter of fact, I think the solution should not be searched in Outlook itself but in de Spelling Checker Engine, which is a kind of "guest-application" in Outlook (and also in Outlook Express). But it seems like there is no way to approach it.

    Just for your peace of mind: I posted my question in 4 forums world wide, where thousands of experienced visitors come every day, and your answer was... the only one! I'm afraid, I asked an impossible question.
    For the time being I solved the problems with a set of "SendKeys" statements. Not elegant at all, but it works...

  4. #4
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Quote Originally Posted by MVFC
    Thanks a lot Ebrew,

    Unfortunately de properties of LanguageSettings do not affect the Spelling Checker but only the User Interfaces, the Install Language etc.
    The LanguagePreferredForEditing property is a predefined register setting, which cannot be changed and is therefore read-only.
    As a matter of fact, I think the solution should not be searched in Outlook itself but in de Spelling Checker Engine, which is a kind of "guest-application" in Outlook (and also in Outlook Express). But it seems like there is no way to approach it.

    Just for your peace of mind: I posted my question in 4 forums world wide, where thousands of experienced visitors come every day, and your answer was... the only one! I'm afraid, I asked an impossible question.
    For the time being I solved the problems with a set of "SendKeys" statements. Not elegant at all, but it works...
    This will be the 2nd answer. Be sure to be seated because this will give you goosebumps ... After some crawling on internet (I know the codes existed but I have forgotten the site), I found what I was looking for. I will post it here for you as an attachment. Import this into an outlookmodule. More info about language codes can be found here : http://support.microsoft.com/kb/221435

    To get this working, just run setlanguagefrenchbelgium or any other sub. Then check out the language the spelling checker is using.

    This one is for outlook 2003. Hope you'll like it.
    Last edited by Charlize; 07-11-2007 at 02:17 AM. Reason: Put everything in a module to be imported.

  5. #5
    VBAX Newbie
    Joined
    Jul 2007
    Posts
    5
    Location

    Talking FAN-TAS-TIC!!!

    Hallo Charlize,

    Thanks a lot-lot-lot!!! The code is fantastic and... it works!
    I had some troubles with it in the beginning as I got no results. The macros did run properly, but the language was not changed. Looking at the register, I saw that the right key was changed according to the macro code, but when I started the speller again, he jumped back to the previous language. Finally I discovered the cause: to test the code I was using one of the existing procedures - 'French Belgium' - but that language is not included in the Speller I have installed on my machine!! So the engine just could not find the language stated in the register and jumped automatically back to the last existing value used. After changing the value passed on from the procedures into a languages I do have on my machine, the macros worked as expected. I have now created a small toolbar with all languages I use (6) in a row and I have all choices right before my eyes when I write a new message. Just one click away...

    Besides, the code is very useful for other purposes too, as it contains several procedures which allow you to manipulate the registers in different ways.

    So thanks again... you are great!

    Bye and have a wonderful day

    MVFC
    </IMG></IMG>

  6. #6
    VBAX Newbie
    Joined
    Oct 2007
    Posts
    2
    Location

    A problem

    Dear MVFC

    Thanks for your posting on this.

    I tried to run the macro under Outlook 2003 and it stop in the following line:

    End Sub InTypes

    informing of a compilation error.

    Can you help me out?

    Best

    je_123

  7. #7
    VBAX Newbie
    Joined
    Jul 2007
    Posts
    5
    Location
    Hi there,

    You probably made a mistake while copying the code.
    After the Statment End Sub no words or signs are allowed.

    Try to delete that "InTypes". It should work.

    Bye for now,
    MVFC

  8. #8
    VBAX Newbie
    Joined
    May 2008
    Posts
    1
    Location

    Thanks

    ... this is a solution I've been searching for quite some time.

  9. #9
    Great! Never want to miss that!
    Thanks to the poster!!

    Justin

  10. #10
    VBAX Newbie
    Joined
    Oct 2008
    Posts
    1
    Location

    Smile Thank you.

    I've been looking for this for a long time.
    It works perfectly.

    Thank you very much.

  11. #11
    Thanks have been looking for this also

  12. #12
    Quote Originally Posted by Charlize
    This will be the 2nd answer. Be sure to be seated because this will give you goosebumps ... After some crawling on internet (I know the codes existed but I have forgotten the site), I found what I was looking for. I will post it here for you as an attachment. Import this into an outlookmodule. More info about language codes can be found here ...

    To get this working, just run setlanguagefrenchbelgium or any other sub. Then check out the language the spelling checker is using.

    This one is for outlook 2003. Hope you'll like it.
    Charlize, I wish I could share an excitment of users that you helped to. Unfortunatelly, I am using Outlook 2007 and the script does not seem to work in it. Do you think you could help me as well?

  13. #13
    VBAX Newbie
    Joined
    Feb 2009
    Posts
    1
    Location
    thx
    helped

  14. #14
    How do i guet the attachment? can you post the code here?

  15. #15

    Code for spell

    Can anyone post here the code provided by Charlize?
    Thanks

  16. #16
    VBAX Newbie
    Joined
    Mar 2009
    Posts
    1
    Location
    Where is the code posted by Charlize ?

  17. #17
    that's also my question...

  18. #18
    I have signed up, updated flash, and switched browsers...still can't find the attachment. Has it been deleted?

  19. #19
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Attached a zipfile of the whole routine. Import the bas file into a module. Scroll down and read the text in capital letters. I'll post important part here. It is for office 2003 only. If you want 2007 you'll probably need to alter the path.

    Charlize

    ' GET/SET SPELLING LANGUAGE FOR OUTLOOK 2003
    'Created by D.Hlad - This code is public domain
    
    Sub GetCurrentSpellingLanguage()
    Dim CurrentSpellingLanguage As String
    'REMARK BY CHARLIZE : LOOK AT THE PATHSTRING = THE ONE FOR OFFICE 2003
    'OTHER OFFICES HAVE PROBABLY A DIFFERENT PATH
        CurrentSpellingLanguage = ReadRegistry(HKEY_CURRENT_USER, "Software\Microsoft\Office\11.0\Outlook\Options\Spelling\", "Speller")
    End Sub
    
    Sub SetSpellingLanguage(LanguageCode As String)
    Dim NewSpellingLanguage As String
        NewSpellingLanguage = LanguageCode & "\Normal"
        WriteRegistry HKEY_CURRENT_USER, "Software\Microsoft\Office\11.0\Outlook\Options\Spelling\", "Speller", ValString, NewSpellingLanguage
    End Sub
    
    Sub SetLanguageDutchBelgium()
    'These are the routines you call to change spellinglanguage
    'Website holding the codes : http://support.microsoft.com/kb/221435
        SetSpellingLanguage ("2067")
    End Sub
    
    Sub setlanguageFrenchBelgium()
        SetSpellingLanguage ("2060")
    End Sub
    
    Sub SetLanguageUK()
        SetSpellingLanguage ("2057")
    End Sub
    
    Sub SetLanguageUS()
        SetSpellingLanguage ("1033")
    End Sub
    
    Sub SetLanguageES()
        SetSpellingLanguage ("3082")
    End Sub
    
    Sub SetLanguageHR()
        SetSpellingLanguage ("1050")
    End Sub
    
    Sub SetLanguageCAT()
        SetSpellingLanguage ("1027")
    End Sub
    
    Sub SetLanguagePOR()
        SetSpellingLanguage ("2070")
    End Sub
    Last edited by Aussiebear; 04-20-2023 at 05:47 AM. Reason: Adjusted the code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •