In today’s article, we would like to present you 2 methods to count the total words of one language in a multi-language Word document.
Once in a while, some of you may have the demand to edit a multi-language Word document. As a result, there will be times you want to do word count for one specific language, but only to find Word unable to perform this task.
Then it is out aim to provide you with 2 useful solutions to address such an issue.
Method 1: Use “Advanced Find” Option
- First off, click the upside-down triangle button behind “Find” in “Editing” group under “Home” tab.
- Now in “Find and Replace” dialog box, click “More” button.
- And check the “Find whole words only” box.
- Then click “Format” button.
- Next choose “Language”.
- In “Find Language” dialog box, find and select the target language and click “OK”.
- Now back to “Find and Replace” box, click the “Find In” and choose “Main Document”.
- Next all English words shall be selected and go to check the word count on the down-left corner of the screen. We can see the number is 93.
Method 2: Run Word Macro
- To start with, click “Developer” tab.
- Then click “Visual Basic” to trigger the VBA editor. In case you haven’t had the “Developer” tab enabled yet, press “Alt+ F11” instead.
- Next click “Normal” and then click “Insert”.
- Choose “Module”.
- And double click on the new module to open the coding space.
- Then paste the following codes there:
Sub CountTotalWordsOfOneLanguage() Dim objRange As Range Dim nWords As Long ' Initialization Set objRange = ActiveDocument.Range nWords = 0 ' Find all English words and do word count. With objRange.Find .LanguageID = wdFrench Do While .Execute nWords = nWords + objRange.ComputeStatistics(wdStatisticWords) Loop End With MsgBox nWords End Sub
- Lastly, click “Run” button.
There shall be a message box popping up. The number refers to the total words of French texts in this document.
Note:
In code line “.LanguageID = wdFrench”, the “wdFrench” means French language. To customize the codes for more specific use, you can replace the language ID with the exact language you want. And for the more language ID, you can visit: https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2003/aa172988(v=office.11)
Properly Handle Corrupted Word Files
Now and then, Word will shut down or freeze because of all kinds of errors or mistakes. Say, if you fail to back up files on a regular basis, there is a great possibility to lose all the precious data. And the 2 workarounds left is either to utilize the built-in function of Word or obtain a program to repair doc. Given the fact that the former doesn’t seem work so well in most time, it’s advisable to choose a third-party tool.
Author Introduction:
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including Excel fix and pdf repair software products. For more information visit www.datanumen.com