Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-27-2015, 01:54 PM
yong321 yong321 is offline Spell check in two languages Windows XP Spell check in two languages Office XP
Novice
Spell check in two languages
 
Join Date: Sep 2015
Posts: 10
yong321 is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 11-27-2015, 02:27 PM
macropod's Avatar
macropod macropod is offline Spell check in two languages Windows 7 64bit Spell check in two languages Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 11-27-2015, 03:50 PM
yong321 yong321 is offline Spell check in two languages Windows XP Spell check in two languages Office XP
Novice
Spell check in two languages
 
Join Date: Sep 2015
Posts: 10
yong321 is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
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.
Thanks. Mine is actually worse that that! It's more or less like a Spanish-English dictionary. Although English words dominate, there are just too many Spanish words scattered around. I can't highlight each Spanish word on each page and apply a separate style to them. Well, I can, but it would take too long.

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).
Reply With Quote
  #4  
Old 11-27-2015, 04:59 PM
Charles Kenyon Charles Kenyon is offline Spell check in two languages Windows 8 Spell check in two languages Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,138
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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.
Attached Images
File Type: png 00 deleteme 2.png (13.7 KB, 25 views)
Reply With Quote
  #5  
Old 11-27-2015, 07:19 PM
yong321 yong321 is offline Spell check in two languages Windows 7 32bit Spell check in two languages Office 2010 32bit
Novice
Spell check in two languages
 
Join Date: Sep 2015
Posts: 10
yong321 is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
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.
Using the style to solve the problem still requires that I select individual Spanish words on each page. Right? I can press and hold Control and double click each Spanish word, then apply a style. But that's still a very tedious process for a few hundred pages. If I misunderstand, kindly let me know.
Reply With Quote
  #6  
Old 11-27-2015, 08:19 PM
macropod's Avatar
macropod macropod is offline Spell check in two languages Windows 7 64bit Spell check in two languages Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #7  
Old 11-27-2015, 09:17 PM
Charles Kenyon Charles Kenyon is offline Spell check in two languages Windows 8 Spell check in two languages Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,138
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by yong321 View Post
Using the style to solve the problem still requires that I select individual Spanish words on each page. Right? I can press and hold Control and double click each Spanish word, then apply a style. But that's still a very tedious process for a few hundred pages. If I misunderstand, kindly let me know.
You did not misunderstand. On the other hand if done as you type, it is not that big a task. As pointed out, if there is already some kind of different formatting applied, a simple Replace will apply the style.

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.
Reply With Quote
  #8  
Old 11-27-2015, 11:14 PM
yong321 yong321 is offline Spell check in two languages Windows 7 32bit Spell check in two languages Office 2010 32bit
Novice
Spell check in two languages
 
Join Date: Sep 2015
Posts: 10
yong321 is on a distinguished road
Default

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.
Reply With Quote
  #9  
Old 11-28-2015, 12:19 AM
macropod's Avatar
macropod macropod is offline Spell check in two languages Windows 7 64bit Spell check in two languages Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #10  
Old 11-28-2015, 08:34 AM
yong321 yong321 is offline Spell check in two languages Windows 7 32bit Spell check in two languages Office 2010 32bit
Novice
Spell check in two languages
 
Join Date: Sep 2015
Posts: 10
yong321 is on a distinguished road
Default

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.
Reply With Quote
  #11  
Old 11-28-2015, 01:35 PM
macropod's Avatar
macropod macropod is offline Spell check in two languages Windows 7 64bit Spell check in two languages Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #12  
Old 11-28-2015, 04:10 PM
yong321 yong321 is offline Spell check in two languages Windows 7 32bit Spell check in two languages Office 2010 32bit
Novice
Spell check in two languages
 
Join Date: Sep 2015
Posts: 10
yong321 is on a distinguished road
Default

Paul,

Thank you for clarification. Now I understand.

Have a late Thanksgiving holiday!
Reply With Quote
  #13  
Old 12-06-2015, 04:09 PM
yong321 yong321 is offline Spell check in two languages Windows 7 32bit Spell check in two languages Office 2010 32bit
Novice
Spell check in two languages
 
Join Date: Sep 2015
Posts: 10
yong321 is on a distinguished road
Default

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.
Reply With Quote
  #14  
Old 12-06-2015, 04:28 PM
macropod's Avatar
macropod macropod is offline Spell check in two languages Windows 7 64bit Spell check in two languages Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #15  
Old 12-06-2015, 08:05 PM
yong321 yong321 is offline Spell check in two languages Windows 7 32bit Spell check in two languages Office 2010 32bit
Novice
Spell check in two languages
 
Join Date: Sep 2015
Posts: 10
yong321 is on a distinguished road
Default

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell Check HondaS600 Office 5 08-26-2013 01:04 PM
Spell check in two languages spell check error Straitsfan Word 1 09-16-2012 03:35 PM
Spell check in two languages spell checker won't check mrmagoo Word 1 08-25-2012 04:55 PM
Spell check in two languages Spell Check CommoMP Word 5 05-30-2011 05:40 PM
Spell Check WorkerB Word 2 11-21-2009 07:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:25 PM.


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