Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-25-2014, 02:04 AM
DaveW DaveW is offline How to identify languages in Word document Windows 7 64bit How to identify languages in Word document Office 2010 64bit
Novice
How to identify languages in Word document
 
Join Date: Jun 2014
Location: Birmingham, UK
Posts: 4
DaveW is on a distinguished road
Default How to identify languages in Word document

Hi,

I'm using Word 2010, and I have received a Word document that contains both German and Polish text, but the language of the document is set to German throughout.



Is there any function in Word that I can use to identify all (or most) of the Polish parts of the text and mark them with correct language? I know that Word has this kind of language identification functionality since it is able have a shot at identifying your language as you type, but I can't see any function for processing an existing document in this way.

Please help; I really don't want to have to do this manually!

Thanks in advance for any replies,
Dave
Reply With Quote
  #2  
Old 06-25-2014, 06:35 AM
Charles Kenyon Charles Kenyon is offline How to identify languages in Word document Windows 7 64bit How to identify languages in Word document Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,081
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

I know of no such function and usually have the automatic recognition as you type turned off because, for me, it causes more headaches than it relieves.
Reply With Quote
  #3  
Old 06-25-2014, 06:49 AM
DaveW DaveW is offline How to identify languages in Word document Windows 7 64bit How to identify languages in Word document Office 2010 64bit
Novice
How to identify languages in Word document
 
Join Date: Jun 2014
Location: Birmingham, UK
Posts: 4
DaveW is on a distinguished road
Default

Yes, you, I and, to judge from forum posts, 99% of other Word users turn the automatic language detection off because of the annoyance it causes during normal text editing.

That makes it doubly annoying that the functionality cannot be accessed for one of the few circumstances in it would be genuinely useful! I have a large document with alternating German and Polish sentences, and I need to hide the Polish parts (so that they are ignored by translation software). So it seems that the only way to do this is to manually identify and mark each Polish sentence even though, theoretically, Word has the functionality to detect language!
Reply With Quote
  #4  
Old 06-25-2014, 07:12 AM
NobodysPerfect NobodysPerfect is offline How to identify languages in Word document Windows 8 How to identify languages in Word document Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Hi,

as the whole document is set to German languageID, you can use the spellchecker to have all 'incorrect' words/sentences/passages marked. Than you can select theses passges and set the language to Polish. IMHO that seems to be the fastest way to do that manually.

NP
Reply With Quote
  #5  
Old 06-25-2014, 07:38 AM
DaveW DaveW is offline How to identify languages in Word document Windows 7 64bit How to identify languages in Word document Office 2010 64bit
Novice
How to identify languages in Word document
 
Join Date: Jun 2014
Location: Birmingham, UK
Posts: 4
DaveW is on a distinguished road
Default

Well, yes, that was what I was hoping to avoid. There are hundreds of alternating German / Polish sentences in the document, and it'll be a right pain to go through and mark them all manually. What a shame that Microsoft's automatic language detection can't be used for this purpose!
Reply With Quote
  #6  
Old 06-25-2014, 07:55 AM
NobodysPerfect NobodysPerfect is offline How to identify languages in Word document Windows 8 How to identify languages in Word document Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Stupid work, I see ...

Maybe there is a VBA based solution: Looping through all paragraphs and counting misspelled words. Whenever - lets say - five misspelled words are found at the beginning of a paragraph the language ID will be set to Polish.

NP
Reply With Quote
  #7  
Old 06-25-2014, 08:00 AM
DaveW DaveW is offline How to identify languages in Word document Windows 7 64bit How to identify languages in Word document Office 2010 64bit
Novice
How to identify languages in Word document
 
Join Date: Jun 2014
Location: Birmingham, UK
Posts: 4
DaveW is on a distinguished road
Default

Yes, that's an idea. Or maybe it's possible to access the language detection functionality from a VBA macro. Thanks!
Reply With Quote
  #8  
Old 06-25-2014, 08:08 AM
NobodysPerfect NobodysPerfect is offline How to identify languages in Word document Windows 8 How to identify languages in Word document Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

http://gregmaxey.com/word_tip_pages/..._document.html

HTH
NP
Reply With Quote
  #9  
Old 06-25-2014, 09:23 AM
NobodysPerfect NobodysPerfect is offline How to identify languages in Word document Windows 8 How to identify languages in Word document Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Another possibility:

Search for typical Polish words (VBA). Set range on paragraph where .Found = True, set languageID to Polish, continue search.

That's not too tricky - if you know typical Polish words .

Cheers
NP
Reply With Quote
  #10  
Old 06-25-2014, 11:15 PM
eNGiNe eNGiNe is offline How to identify languages in Word document Windows 7 32bit How to identify languages in Word document Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

Only you can decide whether it's worth the effort, and only you know the visual relationship of the two languages in the doucment … but perhaps you could roll up your sleeves and go for a two-column layout where the different languages use different styles.

.mif, which I believe most translation software is happy with, lets you wrap phrases in a language tag – but it's not really meant for humans to write. The xml lang attribute can also help. Unfortunately, I can't see any option that would save you from the chore of having to prep your text outside Word.
Reply With Quote
  #11  
Old 06-25-2014, 11:37 PM
NobodysPerfect NobodysPerfect is offline How to identify languages in Word document Windows 8 How to identify languages in Word document Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Quote:
Another possibility:

Search for typical Polish words (VBA).
Not need to search for words. As the Polish alphabet is very different to the German, it should be enough to search for a 'typical' character e.g. "ł". Then same procedure as mentioned in my last post.

NP

Reply With Quote
  #12  
Old 06-26-2014, 12:02 AM
macropod's Avatar
macropod macropod is offline How to identify languages in Word document Windows 7 32bit How to identify languages in Word document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

You might try a macro like:
Code:
Sub SetPolishSpelling()
Dim i As Long, j As Long, k As Long
With ActiveDocument
  Application.ResetIgnoreAll
  With .Range
    .LanguageID = wdGerman
    .NoProofing = False
    For i = 1 To .Sentences.Count
      With .Sentences(i)
        If .SpellingErrors.Count > 0 Then
          j = .SpellingErrors.Count
          .LanguageID = wdPolish
          If .SpellingErrors.Count > j Then
            .LanguageID = wdGerman
            For k = 1 To .SpellingErrors.Count
              .SpellingErrors(i).HighlightColorIndex = wdYellow
            Next
          Else
            For k = 1 To .SpellingErrors.Count
              .SpellingErrors(i).HighlightColorIndex = wdBrightGreen
            Next
          End If
        End If
      End With
    Next
  End With
End With
End Sub
In theory, the above macro should convert each 'sentence' that has more spelling errors as a German sentence than as a Polish sentence to Polish. In either case, any residual spelling errors will be highlighted. One limitation of looping through sentences is that what Word VBA regards as a sentence includes phrases terminated by periods such as you might have after an abbreviation (e.g. Mr., Mrs.). If your German & Polish sentences were in different paragraphs, checking would be much easier and probably more reliable.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #13  
Old 06-26-2014, 09:44 PM
fumei fumei is offline How to identify languages in Word document Windows 7 64bit How to identify languages in Word document Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

While it may not at the frontend (in that you would have to go through "manually") if you had the German in one style and the Polish in another style, that would make identification after the easy. You could make each language style have a shortcut (say Ctrl-g and Ctrl-p) which would make assigning the style fairly easy. You can move through a document pretty fast that way.

And if certain characters CAN be used in a paragraph to identify a language then using that to assign a style could be automated. The point being is that once separated by style (and of course the different styles could look the same in terms of FORMAT) performing actions (like hiding them) on the style/language is straightforward.

The above may not help. Just a thought.

Last edited by Charles Kenyon; 06-27-2014 at 06:06 AM.
Reply With Quote
Reply

Tags
indentify, languages, word 2010

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to identify how Word was invoked Sorcerer13 Word VBA 7 04-24-2014 11:15 AM
How to identify whether Word 2007 was used to create a document saved as Word 2003 noviceatwork Word 0 03-08-2012 06:40 AM
How to identify languages in Word document Using two languages in Word 2007 Mkn Word 5 05-31-2010 03:30 AM
How do I paste other Languages in Word documents Bules Word 0 04-19-2010 10:24 AM
C# API to identify the uncommitted changes in Excel and Word document? althafuddeen Excel 0 04-06-2010 07:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:28 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