PDA

View Full Version : Changing language in Outlook 2007



nordic123
05-02-2011, 06:23 PM
Hi,

I have been using Word as my e-mail editor for many years, and have used recorded macros for selecting the language (I use 4 regularly)
But sins changing to Office 2007, the macros do not work.
I tried copying them into a module and ThisOutlookSession, but won’t work.

Has anyone an idea for changing the macro below?

Sub German()
'
' German Macro
' Macro recorded 02-04-98 by Name Name
'
Selection.LanguageID = wdGerman

End Sub


Any help would be appreciated, thanks.

JP2112
05-03-2011, 12:58 PM
I think the syntax has changed?

http://stackoverflow.com/questions/925547/spellcheck-with-vba-in-outlook-2007-in-a-specified-language

nordic123
05-03-2011, 04:11 PM
Thanks JP2112, but it's not whar i'm looking for.
I just need the line: "Selection.LanguageID = wdGerman" translated.
This line works in Words 2007, but not in Outlook 2007.

Regards

JP2112
05-04-2011, 12:29 PM
Thanks JP2112, but it's not whar i'm looking for.
I just need the line: "Selection.LanguageID = wdGerman" translated.
This line works in Words 2007, but not in Outlook 2007.

Regards

I guess I'm not understanding why that link wouldn't be helpful. The poster says "I need to be able to set the language explicitly to German and I found it can be done using Content.LanguageID" which seems to directly answer your question.

If it still doesn't work, you'll need to be more specific than "the macros do not work."

Does the code compile? Does it throw an error when you run it? If so, what is the error number and description?

Have you tried this instead?


Selection.LanguageID = msoLanguageIDGerman

nordic123
05-04-2011, 03:34 PM
Hi JP,

None of this is working.

I don’t know if I have expressed myself clearly.
But in the old days, Office 2003 and before I used Word as my e-mail editor.
Exactly for the spell checking.
And in those days all the features and customizing I had in Word worked in Outlook when using Word, or more direct, Word in Word and Word in Outlook was the same, same features, because Normal.dot was the bases.
Now in Office 2007 and 2010, Outlook has a Word edition with its own “Normal.dot” and its own programming language, or command codes. Not totally sure which expression is the correct one.

Years ago I made a toolbar with national flags where each flag was prompting a macro changing the language. This doesn’t work anymore neither in Word. but have solved the proplem in another way there.

But the point is the WordWord macros do not work in OutlookWord. I have been searching high and low in MS help and found no help.
I think Multilanguage people are few. Honestly I don’t believe this, but MS has not recognized heir existence.
A page “translating” WordWord codes to OutlookWord codes would help. I have tried many combinations of

Selection.LanguageID = msoLanguageIDGerman this code give the error message: Object required!

LanguageSetting = msoLanguageIDGerman this code no message, but doesn’t change the language.

SetSpellingLanguage = msoLanguageIDGerman, no error message, but no change of language either.

Selection.MsoLanguageID = msoLanguageIDGerman, error message: Object required!

Sorry swearing at MS, but in the h…. have they changed the codes???

I hope this gives you some ideas.
And thanks for your effort so fare.

Charlize
05-05-2011, 01:11 AM
Attached you'll find a .bas module wrapped up in a zip file. Unzip the file and import it into outlook into the modules section. Beware that this coding ONLY works for 2003. You'll have to change the paths that refer to the location of office on your computer. The language files have to be installed to (additional numbers for those languagefiles can be found at microsofts website). Scroll down to the bottom where you'll see the REMARK BY CHARLIZE for additional info.

For changing the language you use some subs like :
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
Hope you can alter this to suit your needs.

Charlize

ps: 14.0 = 2010 and 12.0 = 2007 (microsoft didn't liked number 13).

nordic123
05-05-2011, 06:02 PM
Hi everyone,

Problem solved!!!!!!!!


Here is the code making the trick:

Sub ChangeLanguage(lngLanguage As Word.WdLanguageID)
Dim olkItem As Outlook.MailItem, _
wrdDoc As Word.Document, _
wrdSel As Word.Selection
Set olkItem = Outlook.ActiveInspector.CurrentItem
Set wrdDoc = olkItem.GetInspector.WordEditor
Set wrdSel = wrdDoc.Windows(1).Selection
wrdSel.LanguageID = lngLanguage
Set wrdSel = Nothing
Set wrdDoc = Nothing
Set olkItem = Nothing
End Sub

Apparently it is the code above making the trick. With one important matter.

In the VB-editor, under Tools, References, the Microsoft Word 12,0 Object Library, has to be ticked!!!
This makes the macros below work.
I assume the macro above makes OutlookWord belive it is WordWord?

Sub German()
'
' German Macro
'
ChangeLanguage wdGerman

End Sub

Sub Danish()
'
' Danish Macro
'
ChangeLanguage wdDanish


End Sub

Sub EngGB()
'
' EngGB Macro
'
ChangeLanguage wdEnglishUK


End Sub


Sub Spanish()
'
' Spanish Macro
'
ChangeLanguage wdSpanish

End Sub

Sub Swedish()
'
' Swedish Macro
'
ChangeLanguage wdSwedish

End Sub


Further more I have added the macros to the Quick Access Toolbar in Outlook, have had it for a long time in Word.



Go to Customize Quick Access Toolbar, More Commands, Choose Commands From, select Macros, add the macros to the Quick Access Toolbar, order them to your liking, select the macros one by one, click Modify, and select a Button colour to your liking or any of the designs available.
Unfortunately one can’t design at button any more. I have had flags made in 1997 following me through all MS Office changes, but can’t use them any more.




Hope this might help others in the same situation as I was.

Regards
:beerchug: