Using Styles for Proofing Language Settings

Note: This is an Article that was created on the Microsoft Answers site that I saved so it could be edited. Despite appearances, it is not on a Microsoft site, now.

One of the simplest methods to handle problems with proofing language is to create styles that can be used to change the proofing language settings for particular text in a document. See

my other article on Troubleshooting Proofing Language Problems. This article is an offshoot from that one.

Scope: All desktop versions of Word (Windows or Mac)

Level: Beginner to Intermediate

The problem this article addresses is that Word can handle multiple languages in a single document, which may or may not be the language set for the user's system. It can also turn off proofing for certain parts of text regardless of which language they are in. When proofing is turned off on that text, it will not show as a spelling or grammar error regardless of the settings of the computer on which it is opened. (This is different from what happens when you add a flagged word to your dictionary.)

For background, see: Mastering the Spelling Checker by Suzanne Barnhill, MVP

First - Words you do not want flagged at all no matter which language they are in

When you add a flagged word to your dictionary...

That word will no longer show up as flagged in any document on your computer, whether or not you created it.

When you tell Word to Ignore All ...

It will ignore that word throughout the current document... for a while. At some point Word is likely to forget this.

When you tell Word to Hide Spelling Errors in This Document ...

All things that are marked as errors or might be marked in the future will not be displayed as spelling errors on your computer or on any computer that opens the document. You can still explicitly check spelling (i.e. F7) but unless you or someone else does this, they do not show up.

When you mark a word to not check Spelling or Grammar in its proofing language ...

It will not show up as misspelled on any computer. However, the same word, not so marked, will continue to show up as an error.

See Creating "No proofing" styles in Microsoft Word - No Spell Check character style and Code paragraph style - keep text from being checked for spelling or grammar

Second - Words that are in a different language that you want checked in that language

Do not tell Word to automatically detect languages unless you enjoy frustration! It just is not that good at this.

Create and use a character style for each language, other than your base language, that you wish to use.

Macro to create a Character Style to set language for selection to French

One of the simplest methods of setting a variant language in a document is to use a character style with that language setting. Such a style can be assigned to a keyboard shortcut. You can use different names and different language IDs to have different language styles: Language IDs in VBA

Here is a sample macro that creates a character style in the document called "French Language:"

Sub FrenchLanguageCharacterStyleCreate()  ' SEE ALSO ASSIGNSHORTCUTFRENCHLANGUAGE FOLLOWING
    ' Charles Kenyon
    ' Creates a character style named "French Language" in the Active Document
    ' Does NOT apply the style to a selection, simply creates the style
    ' The character style uses the underlying font setting in the paragraph style, it does not change the font.
    ' Applying this will override any direct font formatting such as Bold or Italics.
    ' 18 March 2024
    ' Language IDs https://docs.microsoft.com/en-us/office/vba/api/word.wdlanguageid 
    '
    Dim stlFrench As Style
    '
    On Error GoTo ErrorAlreadyExists
    ' If doing something other than French, change the style name and the languageID throughout this macro
    Set stlFrench = ActiveDocument.Styles.Add(Name:="French Language", Type:=wdStyleTypeCharacter)
    On Error GoTo -1
    With stlFrench
        .Font.Name = ""
        .LanguageID = wdFrench
    End With
    GoTo ExitSub
ErrorAlreadyExists:
    MsgBox Prompt:="Style 'French Language' already exists", Buttons:=vbInformation, title:="Not Needed"
ExitSub:
    Set stlFrench = Nothing
End Sub

Sub AssignShortcutFrenchLanguage()
    '
    ' Charles Kenyon ---- GOES WITH PREVIOUS MACRO
    ' 26 October 2021
    ' Assigns keyboard shortcut Ctrl+Shift+Alt+F to French Language style
    '   Style must exist
    '   Saves this shortcut in the active document
    '
    CustomizationContext = ActiveDocument    ' Change ActiveDocument to NormalTemplate if style is in Normal Template
    '   Change the wdKeyF to appropriate key if changing and use the style name used in the macro above for Command
    KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyF, wdKeyControl, _
                                          wdKeyShift, wdKeyAlt), _
                                          KeyCategory:=wdKeyCategoryStyle, _
                                          Command:="French Language" ' Note, this must be the same name assigned in first macro.
End Sub

See: Instructions for Installing Macros from Forums or Websites by Graham Mayor, MVP

When you want to return to the underlying or base language, the keyboard shortcut Ctrl+Spacebar returns to the underlying paragraph style (and language).

See also this thread on How to remove language from a style. (Hint: you can't do it. You can change the language, but not remove it.)

I've added a macro to mark text as French with a link to the other language IDs.

Volunteering to "pay forward" the help I've received in the Microsoft user community.

Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

See this thread on How to remove language from a style.

(Hint: It cannot be done. You can change the language setting but you cannot remove it.)

I've added public feedback about this. Feel free to comment and vote.

Volunteering to "pay forward" the help I've received in the Microsoft user community.

Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

2 people found this comment helpful

*
Please select edit reason
 
 

Forum Article Info


Last updated May 10, 2025 Views 1,089
Top Content
Applies to: