Skip to content

Instantly share code, notes, and snippets.

@mcgr0g
Created November 26, 2016 22:48
Show Gist options
  • Save mcgr0g/19c0f840e945ce265d2eff7e8f3a6627 to your computer and use it in GitHub Desktop.
Save mcgr0g/19c0f840e945ce265d2eff7e8f3a6627 to your computer and use it in GitHub Desktop.
макрос исправления неверного распознавания языка для word. Подробнее по ссылке https://blogs.technet.microsoft.com/tasush/2011/03/09/347/
'Attribute VB_Name = «PrepForSpell»
Sub PrepForSpell()
'Attribute PrepForSpell.VB_Description = «Macro created 31.01.2002 by nnnnnn»
'Attribute PrepForSpell.VB_ProcData.VB_Invoke_Func = «Normal.NewMacros.PrepForSpell»
'
' PrepForSpell Macro
' Macro created 31.01.2002 by nnnnnn
' Adoption for Word 2003/2007/ by Alexey Murzov
'
With Selection
.WholeStory
.LanguageID = wdRussian
.NoProofing = False
.HomeKey Unit:=wdStory
n1 = 0
w1 = "a"
se1 =.End
se2 = -1
Do While se1 <> se2
w1 = Left(Trim(.Words(1)), 1)
If w1 <> «» Then
n1 = Asc(w1)
If (n1 >= 65 And n1 <= 90) Or (n1 >= 97 And n1 <= 122) Then
.Words(1).LanguageID = wdEnglishUS
.Words(1).NoProofing = False
End If
End If
.MoveRight Unit:=wdWord
se2 = se1
se1 =.End
Loop
End With
Application.CheckLanguage = True
If se1 = se2 Then MsgBox «Fixing Eng/Rus language finished.», vbInformation, «»
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment