WScript.Echo(SpellCheck()) Function SpellCheck() 'compatibility check On Error Resume Next Set oWord = CreateObject("Word.Application") If Err Then SpellCheck = "Your system does not support Spell Check." & vbcrlf & _ vbcrlf & "You must have Microsoft Word 97 or higher " & _ "installed to enable this feature." Exit Function End If On Error GoTo 0 With oWord .Visible = false Set spellDoc = .Documents.Add 'trap errors for empty or invalid clipboard contents On Error Resume Next .Selection.Paste If Err Then spellDoc.Close .Quit SpellCheck = "Unable to spell check current clipboard contents." & _ vbcrlf & vbcrlf & "Highlight text selection to spell " & _ "check, use Ctrl + C" & vbcrlf & "to copy it to " & _ "clipboard, then click the Spell Check button." Exit Function End If On Error GoTo 0 strIn = spellDoc.Content.Text spellDoc.CheckSpelling() ' spellDoc.CheckGrammar() strOut = spellDoc.Content.Text If strIn = strOut Then results = "No spelling corrections made." Else results = "Spelling corrections copied to clipboard." End If .Selection.WholeStory .Selection.Copy spellDoc.Close False .Quit True End With SpellCheck = results End Function
Сохраняем код под расширением *.vbs и размещаем ярлычок на видном месте. У меня висит на панели задач. Далее дело техники. Выделяем текст, копируем его в буфер, жмём на ярлык.
Делаем все необходимые замены. После этого, проверенный и отредактированный текст помещается обратно в буфер. Всё! Теперь мы пишем правильно.