在文本框中进行拼写检查 [英] spell check in a textbox

查看:87
本文介绍了在文本框中进行拼写检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用文本框来对其中输入的单词进行拼写检查,请帮助

i have to use a textbox which will do spell check of the words entered inside it ,pls help

推荐答案

嗨.

试试.

hi.

try.

Dim objWord As Object
    Dim objDoc  As Object
    Dim strResult As String

    ''Create a new instance of word Application
    Set objWord = CreateObject("word.Application")

    Select Case objWord.Version
        ''Office 2000
        Case "9.0"
            Set objDoc = objWord.Documents.Add(, , 1, True)
        ''Office XP
        Case "10.0"
            Set objDoc = objWord.Documents.Add(, , 1, True)
        ''Office 97
        Case Else '' Office 97
            Set objDoc = objWord.Documents.Add
    End Select

    objDoc.Content = Text1.Text
    objDoc.CheckSpelling

    strResult = Left(objDoc.Content, Len(objDoc.Content) - 1)

    If Text1.Text = strResult Then
        '' There were no spelling errors, so give the user a
        '' visual signal that something happened
        MsgBox "The spelling check is complete.", vbInformation + vbOKOnly
    End If

    ''Clean up
    objDoc.Close False
    Set objDoc = Nothing
    objWord.Application.Quit True
    Set objWord = Nothing

    '' Replace the selected text with the corrected text. It''s important that
    '' this be done after the "Clean Up" because otherwise there are problems
    '' with the screen not repainting
    Text1.Text = strResult

    Exit Sub





下午我,如果它不工作.
我会尝试回覆.


希望对您有帮助.
祝你好运. :)


-chaosgray-





pm me if its not working.
i''ll try to answer back.


hope it helps.
goodluck. :)


-chaosgray-


您好,
我认为这需要2件事:
1.词典包含许多单词,程序必须比较它的TextBox的每个单词.
2.如果您想使用强大的拼写检查器,则必须使用语法器,例如:
我很努力.
她努力工作. (s)
我可以努力吗? (?)
Hello,
I think it needs 2 matters:
1. A dictionary contains many words that the programme must compare each word of it''s TextBox.
2. If you want a strong spell checker then you have to work on the grammer for example:
I work hard.
She works hard. (s)
may I work hard? (?)


您可以在Google上找到很多,例如:

用于文本框的ASP.NET拼写检查器 [ http://www.aspnetspell.com/ [ ^ ]

http://www.asp.net/community/control-gallery/Item.aspx? i = 865 [^ ]
You can find many of them on google, example:

An ASP.NET Spell Checker for a Textbox[^]

http://www.aspnetspell.com/[^]

http://www.asp.net/community/control-gallery/Item.aspx?i=865[^]


这篇关于在文本框中进行拼写检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆