一个检查E文拼写错误的Code
网络整理 - 09-16
这个函数可以利用MS Word来检查拼写错误,当然只对E文有效,如果Microsoft在中关村我想它对中文肯定是可以的。
<HTML>
<HEAD>
<TITLE> Spell checker</TITLE>
<script LANGUAGE=vbscript>
<!--
Function SpellChecker(TextValue)
Dim objWordobject
Dim objDocobject
Set objWordobject = CreateObject("word.Application")
objWordobject.WindowState = 2
objWordobject.Visible = True
Set objDocobject = objWordobject.Documents.Add( , , 1, True)
objDocobject.Content=TextValue
objDocobject.CheckSpelling
SpellChecker = objDocobject.Content
objDocobject.Close false
Set objDocobject = Nothing
objWordobject.Application.Quit True
Set objWordobject= Nothing
End Function
Sub cmdOk_onclick()
Dim strValue
strValue = frmDemo.txtEditor.value
frmDemo.txtEditor.value = SpellChecker(strValue)
Msgbox "原文是 :" & strValue
End Sub
-->
</script>
</HEAD>
<BODY>
<FORM action="" method=post id=frmDemo name=frmDemo>
<P><TEXTAREA id=txtEditor name=txtEditor rows=11 cols=73></TEXTAREA>
</P>
<input name=cmdOk value=Ok onclick="cmdOk_onclick" type=button>
</Form>
</Body>
</HTML>