Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
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: 22,467
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
 

Tags
indentify, languages, word 2010



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 10:23 AM.


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