Outlook Macro to change proofing language of selected text

Sam Hamels

New Member
Joined
Mar 20, 2018
Messages
49
Hi everyone,

Using the macro recorder in Word, I created the following macro to change the proofing language of whichever text I currently have selected to English. By assigning a hotkey to this macro (ALT+E), I can now very easily and quickly set the proofing language of some text I select to English, whenever Word is not correctly detecting it as English automatically - instead of having to manually open the 'language proofing menu' every time.

VBA Code:
Sub Change_Language_To_English()

    Selection.LanguageID = wdEnglishUK
    Selection.NoProofing = False
    Application.CheckLanguage = False

End Sub

Now I would like to do the same in Windows Outlook desktop 2019, but it lacks a 'record macro' button in the Developer tab. I don't know how to write the correct macro in Outlook-VBA myself - and simply copy-pasting the Word macro in a VBA module in Outlook doesn't seem to work.

Could anyone please suggest what a functioning Outlook macro to set the proofing language of currently selected text to English would look like?

Thanks!
Sam
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
I found out that this works:


VBA Code:
Sub Lang(lngLanguage As Word.WdLanguageID) 
     ' "Tools > References > Microsoft Word 16.0 Object Library" needs to be checked
    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 
     
    wrdDoc.Bookmarks.Add Range:=wrdSel.Range, Name:="TheTemporarySpellerBookmark" 
     
    With wrdSel 
        .WholeStory 
        .LanguageID = lngLanguage 
        .Shrink 
        .GoTo What:=wdGoToBookmark, Name:="TheTemporarySpellerBookmark" 
    End With 
     
    wrdDoc.Bookmarks("TheTemporarySpellerBookmark").Delete 
    Set wrdSel = Nothing 
    Set wrdDoc = Nothing 
    Set olkItem = Nothing 
End Sub 

Sub AllinENG() 
    Lang (wdEnglishUK) 
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top