#1
|
|||
|
|||
Spell check in two languages
My Microsoft Word 2010 document contains words in English and Spanish and they are scattered all around. What's the best way to spell check so that I'm alerted a wrong spelling only if it does not exist in either language? It's impractical to pre-select a block of text in (say) Spanish and check that block only, jump to the next block in English and check it next. There're too many such small blocks. Thanks. |
#2
|
||||
|
||||
In a document that is predominantly in one language, you might define one language for proofing the document as a whole, then use a character Style set for proofing in the other language and apply that to any text in the other language. In a document that mixes two or more languages with none being truly dominant, you might define separate paragraph Styles for each language as well.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Quote:
I thought about cramming a small Spanish dictionary into the custom dictionary. But that would only contain words in their dictionary forms (e.g., palabra would be included but not palabras). |
#4
|
|||
|
|||
You can apply a style using a keyboard shortcut. And you would want to use character styles rather than paragraph styles for this.
It may seem like a lot of trouble, but it nothing like the trouble you can get if you tell Word to automatically detect the language. See below. BTW, you might want to reset your forum profile. Your profile says you are using Windows XP and Office XP. Your question implies otherwise. |
#5
|
|||
|
|||
Quote:
|
#6
|
||||
|
||||
Preferably, one would set this up and use it from the outset, so the task doesn't become a huge one later on. Of course, if the Spanish words are already formatted differently from the English Words, the whole Style application process could be done via Find/Replace.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Quote:
Word simply is not smart enough to figure out what you want formatted one way or the other. When it is allowed to try, it often causes different problems! It will not allow application of two proofing languages to the same word. |
#8
|
|||
|
|||
Thanks Paul and Charles. When I created this Word document, I made sure all words that are not part of the flow of the sentence are italic. For instance, car in English is coche in Spanish. But both car and coche are italic; there's no difference in their style. (A sample page is at http://yong321.freeshell.org/lsw/sample1.html. Headwords are in bold. They are all Spanish for sure.)
I think I'll just use English proofing and visually check as much as I can. Thanks again. |
#9
|
||||
|
||||
Based on what your link shows, try the following macro.
Since your Spanish definitions are in bold type, the macro first builds a list of all those words and applies Spanish proofing to them. The macro then searches for the same words in italics and applies Spanish proofing to them. A progress report is displayed on the status bar for these processes, but they should run very quickly anyway. That should take care of most words. Finally, the macro checks for italicised spelling errors and prompts the user to say whether the word is Spanish; if so, the macro applies Spanish proofing to those words too. Code:
Sub SetSpanishLanguage() Application.ScreenUpdating = False Dim StrTmp As String, i As Long, Rng As Range StrTmp = " " Const StrExcl As String = ".,!¡?¿@#$¢£€%^&*(){}[]:;'~`1234567890-_=+\|“”‘’""" With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "" .Replacement.Text = "" .Font.Bold = True .Format = True .Forward = True .Wrap = wdFindStop .Execute End With Do While .Find.Found If InStr(StrTmp, " " & .Text & " ") = 0 Then i = i + 1 Application.StatusBar = "Adding word " & i & " to Dictionary, please wait." StrTmp = StrTmp & .Text & " " End If .LanguageID = wdSpanish .Collapse wdCollapseEnd .Find.Execute Loop DoEvents For i = 1 To Len(StrExcl) StrTmp = Replace(StrTmp, Mid(StrExcl, i, 1), "") Next With .Find .ClearFormatting .Replacement.ClearFormatting .Replacement.LanguageID = wdSpanish .Font.Italic = True .Format = True .Forward = True .Wrap = wdFindContinue .MatchCase = False .MatchWholeWord = True .MatchWildcards = False For i = 1 To UBound(Split(StrTmp, " ")) - 1 Application.StatusBar = "Adding Spanish Proofing to word " & i & ", please wait." .Text = Split(StrTmp, " ")(i) .Replacement.Text = "^&" .Execute Replace:=wdReplaceAll Next End With End With Application.ScreenUpdating = True With ActiveDocument.Range For Each Rng In .SpellingErrors With Rng If .Font.Italic = True Then .Select If MsgBox("Is this a Spanish word?", vbYesNo, "Language Checker") = vbYes Then .LanguageID = wdSpanish End If End If End With Next End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
Paul,
Thank you very much for being so willing to help me! I tried your code on a few pages. It looks like the spell checker does not understand basic Spanish words, such as prender ("to seize"). In one run, it even prompted to confirm on si ("if"). I experimented with setting different proofing languages (not sure if it's needed), Spanish (United States), Spanish (Mexico), English, ... It doesn't seem to make a difference. |
#11
|
||||
|
||||
As advised in my previous post, the macro only applies the Spanish language to bold words and italicised words for which there is a bold one. It does not apply the Spanish language to other italicised words; instead, it locates just those italicised words that show up as spelling errors in English and asks the user whether they're Spanish. If so, the language settings for those words are updated.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#12
|
|||
|
|||
Paul,
Thank you for clarification. Now I understand. Have a late Thanksgiving holiday! |
#13
|
|||
|
|||
A perfect workaround is found. According to George Chacon's message on 8/1/2014, Google Chrome can do this. So now I just copy my text one big chunk at a time into a big textarea in the Chrome browser.
The link is at https://productforums.google.com/for...me/3KALydhVjVo Last edited by yong321; 12-07-2015 at 11:19 AM. |
#14
|
||||
|
||||
Somehow I can't see that resolving how Word handles the languages, though. Even if you do a spell-check in Google Chrome and fix it there, that's not going to change whether Word regards something as an apparent spelling error when you copy the content back into Word.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#15
|
|||
|
|||
Sorry I was not clear. It's not a workaround if you insist on working in Word only. It's a workaround for people like me that just want to have simultaneous multi-language spell checking. It won't magically highlight spellings in Word that are not correct in either language, but it solves my problem anyway. I thought some readers would find this helpful.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Spell Check | HondaS600 | Office | 5 | 08-26-2013 01:04 PM |
spell check error | Straitsfan | Word | 1 | 09-16-2012 03:35 PM |
spell checker won't check | mrmagoo | Word | 1 | 08-25-2012 04:55 PM |
Spell Check | CommoMP | Word | 5 | 05-30-2011 05:40 PM |
Spell Check | WorkerB | Word | 2 | 11-21-2009 07:22 AM |