' Spell-Checker for clipboard contents. Requires MS Word ' Steve Yandl, October 23, 2000 ' ///////////////////////////////////////////////////////////////// ' Dim oWD, RangeOriginal, RangeCorrected, Cnt, Status Set oWD = WScript.CreateObject("Word.Application") oWD.Visible =false oWD.Documents.Add On Error Resume Next oWD.Selection.Paste If err.number<>0 then MsgBox "Clipboard was Empty" oWD.ActiveDocument.Close wdDoNotSaveChanges oWD.Quit Set oWD=Nothing Set oWD=Nothing WScript.Quit End If ' Set RangeOriginal=oWD.ActiveDocument.Range(0,oWD.Selection.End) If oWD.CheckSpelling(RangeOriginal)=False Then oWD.ActiveDocument.CheckSpelling Set RangeCorrected = oWD.ActiveDocument.Range(0,oWD.Selection.End) RangeCorrected.copy ' If RangeCorrected.Words.Count>7 Then Cnt=RangeCorrected.Words.Count Status= "Текст, начинающийся с: "&_ RangeCorrected.Words.Item(1)&" "&RangeCorrected.Words.Item(2)&" "&_ RangeCorrected.Words.Item(3)&"....."&vbCRLF&"и заканчивающийся: ....."&_ RangeCorrected.Words.Item(Cnt-2)&" "&RangeCorrected.Words.Item(Cnt-1)&_ " "&RangeCorrected.Words.Item(Cnt)&vbCRLF&"проверен. "&_ "Исправленный текст скопирован в буфер обмена." Else Status= "<< "&RangeCorrected&" >>"&vbCRLF&"был проверен."&_ " Исправленный текст скопирован в буфер обмена." End If ' Else Status= "Проверка завершена. Текст не содержит ошибок." End If ' oWD.ActiveDocument.Close wdDoNotSaveChanges oWD.Quit Set oWD=Nothing MsgBox Status