Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-31-2015, 10:04 PM
mohsen.amiri mohsen.amiri is offline Finding Non-English Words in an English and Non-English words document Windows XP Finding Non-English Words in an English and Non-English words document Office 2007
Competent Performer
Finding Non-English Words in an English and Non-English words document
 
Join Date: Aug 2014
Posts: 221
mohsen.amiri is an unknown quantity at this point
Default 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
Reply With Quote
  #2  
Old 03-31-2015, 10:29 PM
gmayor's Avatar
gmayor gmayor is offline Finding Non-English Words in an English and Non-English words document Windows 7 64bit Finding Non-English Words in an English and Non-English words document Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
The macro highlights all the text, then searches for text that is English (you need to specify which flavour of English is not US English) and removes the highlight from that text.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 03-31-2015, 10:58 PM
mohsen.amiri mohsen.amiri is offline Finding Non-English Words in an English and Non-English words document Windows XP Finding Non-English Words in an English and Non-English words document Office 2007
Competent Performer
Finding Non-English Words in an English and Non-English words document
 
Join Date: Aug 2014
Posts: 221
mohsen.amiri is an unknown quantity at this point
Default

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
Reply With Quote
  #4  
Old 03-31-2015, 11:20 PM
gmayor's Avatar
gmayor gmayor is offline Finding Non-English Words in an English and Non-English words document Windows 7 64bit Finding Non-English Words in an English and Non-English words document Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
Reply

Tags
english non-english find

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding Non-English Words in an English and Non-English words document 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
Finding Non-English Words in an English and Non-English words document Translate from English to Spanish marge0513 Word 1 05-30-2009 06:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:45 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft