|
FunctionCheckSpell(IncorrectTextasstring)asstring DimWordAsObject,retText$ OnErrorResumeNext '建立对象并打开WORD SetWord=CreateObject("Word.Basic")
'把需要检查的STRING放到WORD Word.AppShow Word.FileNew Word.InsertIncorrectText
'运行WORD拼写检查 Word.ToolsSpelling Word.EditSelectAll
'取返回值 retText=Word.Selection$() CheckSpell=Left$(retText,Len(retText)-1)
'关闭文件并回到VB应用 Word.FileClose2 Show
SetWord=Nothing EndFunction->
|
| |
|