一个检查E文拼写错误的Code
2001-07-11 11:03:33 来源:WEB开发网核心提示:这个函数可以利用MS Word来检查拼写错误,当然只对E文有效,一个检查E文拼写错误的Code,如果Microsoft在中关村我想它对中文肯定是可以的,<HTML><HEAD><TITLE> Spell checker</TITLE><SCRipT LANGUAGE
这个函数可以利用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 style="WIDTH: 665px; HEIGHT: 217px" name=txtEditor rows=11 cols=73></TEXTAREA>
</P>
<input name=cmdOk value=Ok onclick="cmdOk_onclick" type=button>
</Form>
</Body>
</HTML>
如果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 style="WIDTH: 665px; HEIGHT: 217px" name=txtEditor rows=11 cols=73></TEXTAREA>
</P>
<input name=cmdOk value=Ok onclick="cmdOk_onclick" type=button>
</Form>
</Body>
</HTML>
赞助商链接