Welcome / Bienvenue / Benvinguts / Bienvenidos
For information about my translation services, please visit the main site.
Pour des informations sur mes services, merci de regarder le site principal.
Para información sobre mis servicios de traducción, visite el web principal.

How to change the language in all stories (including comments) in a Word document

Updated version uploaded on 1 December 2022. This updated version includes a correction of the error that was in the video and other minor tweaks, and it now updates the language in certain cases where it previously did not work.

Ever felt frustrated when Word keeps selecting the wrong language every time you add a comment? This video explains how to change the language for all elements of a Word document, including footnotes, comments and text boxed, in an instant.

The macro code is below. The video explains how to import the code. Note that near the top of the code, sandwiched between asterisks, there is a line you may need to change, depending on the language and variety that you want to use.

Please leave a comment to let me know whether it works for you.


Sub LanguageAllStyles()

Dim LanguageId As MsoLanguageID

'***************
LanguageId = msoLanguageIDEnglishUK ' Insert the Name or the Value listed at https://learn.microsoft.com/en-us/office/vba/api/word.wdlanguageid.

'***************

' Macro to change language in styles
' Loosely based on a macro posted by Macropod (17 July 2012)
' http://www.vbaexpress.com/forum/showthread.php?42993-Solved-Macro-to-change-all-styles-to-a-specific-languageDim TrackChangesActive As Boolean ' Only possible values are True/False

Dim CheckSpellingAsYouTypeActive As Boolean
Dim CheckGrammarAsYouTypeActive As Boolean
Dim ShowFormatChanges As Boolean
Dim doc As Document
Dim SkipTrackChangesQuestion As Boolean

Dim oDoc As Document, oSty As Style, oStor As Range

Application.ScreenUpdating = False

'Block taken from my personal “MacroSwitchesOff” code
If Options.CheckSpellingAsYouType = True Then CheckSpellingAsYouTypeActive = True Else CheckSpellingAsYouTypeActive = False ' Checks whether CheckSpellingAsYouType is switched on.
Options.CheckSpellingAsYouType = False
' Forces Word to check everything again with the new language. Cancel the above line if you don’t want Word to forget when you’ve “Ignored” a flagged spelling.
' Without switching this setting off and on, Word still underlines words that are correctly written in the new language.
If Options.CheckGrammarAsYouType = True Then CheckGrammarAsYouTypeActive = True Else CheckGrammarAsYouTypeActive = False
Options.CheckGrammarAsYouType = False
' See previous comment

If ActiveDocument.ActiveWindow.View.ShowFormatChanges = True Then ShowFormatChanges = True Else ShowFormatChanges = False
ActiveDocument.ActiveWindow.View.ShowFormatChanges = False
'Check whether Format changes are shown

If ActiveDocument.TrackRevisions = True Then TrackChangesActive = True Else TrackChangesActive = False

If SkipTrackChangesQuestion <> True Then ' Skip the track changes question
If MsgBox("Perform the operation with track changes?", _
vbYesNoCancel) = vbNo Then
ActiveDocument.TrackRevisions = False
Else
ActiveDocument.TrackRevisions = True
End If
End If

Set oDoc = ActiveDocument
With oDoc
For Each oSty In .Styles
StatusBar = oSty
On Error Resume Next
oSty.LanguageId = LanguageId
On Error GoTo 0
Next
End With

With oDoc
For Each oStor In .StoryRanges
StatusBar = "Setting story " & oStor & " to language " & LanguageId
oStor.LanguageId = LanguageId
Next oStor
End With

ActiveDocument.Range.LanguageId = LanguageId ' Uses the normal method, equivalent of pressing ctrl+a and setting the language.

'Block taken from my personal “MacroSwitchesOnAgain” code
' The lines below revert settings to the status they had before the macro was run
If TrackChangesActive = True Then ActiveDocument.TrackRevisions = True
If CheckSpellingAsYouTypeActive = True Then Options.CheckSpellingAsYouType = True
If CheckGrammarAsYouTypeActive = True Then Options.CheckGrammarAsYouType = True
If ShowFormatChanges = True Then ActiveDocument.ActiveWindow.View.ShowFormatChanges = True
ActiveDocument.ActiveWindow.View.ShowFormatChanges = True

Application.ScreenUpdating = True

MsgBox ("Finished! The language of all sections of the document has been set to " & LanguageId & ". If you wanted to select another language, open the VBA editor by pressing alt+f11 and change the 'LanguageID' shown at the top of the script")
End Sub

Share:

Configuration de l’orthographe traditionnelle dans Word

Word vous souligne le mot “oignon”, ou il ne vous signale pas que vous avez oublié l’accent circonflexe sur le mot “parait”? C’est parce que par défaut Word utilise l’orthographe réformée de 1990.

Si, comme moi, vous préférez l’orthographe traditionnelle, ou c’est ce que votre client exige, il suffit de changer les options dans Word. Cette vidéo vous expliquera comment le faire.

Share:

Translator productivity – video 3: Verbatim Google searches

Google used to allow the plus symbol to be used for verbatim searches, forcing Google to search for exactly what we type in, rather than trying to guess what we might mean. When Google introduced Google+, they removed this usage of the plus sign, and informed users that they should use quotation marks instead. Only problem is, as shown in the video, this new method is not reliable.

In the video, I demonstrate how using the plus symbol and the quotation marks don’t work, and show you how to make sure you perform a verbatim search.

Link mentioned in the video for performing verbatim searches: Translator productivity – video 2: https://www.google.com/webhp?tbs=li:1

File to add Google verbatim searches to Intelliwebsearch: IWS Google verbatim.

Share:

Translator productivity – video 2: Problems with Microsoft Word comments

This video explains how to deal with two problems translators and editors encounter when working with comments in the latest versions of Microsoft Word. It explains how to prevent comments from running off the side of the screen, and how to print without markup by default.

The macro referred to in the video is as follows.

Sub LegacyPrint()
'
' LegacyPrint Macro

'This section prints without comments
'Add apostrophes to the start of the lines below if you prefer to print with comments when they are visible.
With ActiveDocument
.ShowRevisions = False
Dialogs(wdDialogFilePrint).Show
.ShowRevisions = True
End With
'End of section

'This section allows you to print using the legacy print window without removing the comments
'Remove the apostrophes on each line below and add them above if you prefer to print with comments
'With ActiveWindow
'.DisplayHorizontalScrollBar = True
'.DisplayVerticalScrollBar = True
'End With
'Dialogs(wdDialogFilePrint).Show
'End of section

End Sub

Please leave a comment to say whether you managed to get this to work, as it helps me know whether my posts are user-friendly.

Share:

Translator productivity – video 1: creating a backup plan

In this video I explain how to create a backup plan and how to implement it using Freefilesync. I explain how to ensure that your drive partitions always use the same drive letter. I also show you how to include software configuration files in your backup. Finally, I explain how to move your backup between your desktop computer and your laptop.

Stay tuned for more translator productivity videos.

Share: