Wednesday, August 1, 2007

spell check

Function CheckSpellErrors(Var)
Set obj = CreateObject("Word.Application")
obj.WordBasic.FileNew
obj.WordBasic.Insert Var
Set SpellErrCollection = obj.ActiveDocument.SpellingErrors
For each element in SpellErrCollection
CreateObject("wscript.shell").popup element,1,"Spell Error"
Next
NoofErrors = obj.ActiveDocument.SpellingErrors.Count
obj.Documents.Close (False)
obj.Quit
Set SpellErrCollection = Nothing
Set obj = Nothing
CheckSpellErrors = NoofErrors
End Function

Msgbox "Spell Error Count = "&CheckSpellErrors("Checki spelling Usingg Automated Testingz")

1 comment:

Anonymous said...

hiii arun ,

how can i check spell errors of a given page