#1
|
|||
|
|||
Finding Non-English Words in an English and Non-English words document
Hello
How can Find (I mean Select) all non-English words in a Microsoft Word document which has English and non-English words mixed? I want to select all Non-English words NOT just a word. Mohsen |
#2
|
||||
|
||||
It depends on how the document is formatted. A correctly formatted document would have the appropriate language proofing parameter applied to the texts. Then it would be fairly straightforward to search for the required language by searching for text with the proofing language applied. If however the document doesn't have the proofing languages applied, the words not in the default language could be flagged as incorrectly spelled, but languages have a way of sharing words, so you would have to determine by eye whether a correctly spelled word belonged to one language or the other.
If the document is correctly formatted with respect to language, the following macro should get you started. Code:
Sub HighlightLanguage() Dim oRng As Range Set oRng = ActiveDocument.Range oRng.HighlightColorIndex = wdYellow With oRng.Find .LanguageID = wdEnglishUS 'Or wdEnglishUK Do While .Execute 'Do something with the found text e.g oRng.HighlightColorIndex = wdNoHighlight Loop End With lbl_Exit: Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
gmayor
Thank you so much. Another way which I found is using Ctrl+F and click on Format>Language...> to open Find Language dialogue box. Here you can select sightly language and then it will find and select (highlight) JUST that language's words. Mohsen |
#4
|
||||
|
||||
Indeed - my suggestion was based on that premise, but assumed multiple languages. But they only work if the document is correctly formatted with respect to language.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Tags |
english non-english find |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Spanish characters in English Word document | SErnewin | Word | 1 | 03-20-2015 10:41 PM |
Canadian multilingual English | Hassan Eltaher | Word | 0 | 03-01-2014 04:23 PM |
remain english words only | tomlam | Excel | 4 | 05-12-2013 07:53 PM |
create PPT in English and another language | gonen | PowerPoint | 0 | 05-23-2012 09:25 AM |
Translate from English to Spanish | marge0513 | Word | 1 | 05-30-2009 06:10 AM |