VB6.0中的拼写检查问题 [英] Spell Check Issue in VB6.0

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

问题描述

HI,
我在vb 6.0中写了四个文本BOxes,用于拼写检查.问题是屏幕闪烁/变得怪异.在此问题上没有任何帮助.
注意:我使用了Word对象并完成了编码.任何人都可以建议摆脱此问题.

我的代码是


I am having Four text BOxes i writted code in vb 6.0 ,for spell check.the problem is the screen is flickering/or becoming weird.can any one help in this isuue.
Note:i used Word object and done the coding.can any one suggest to get out of this.

My code is

<pre lang="vb">

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

    ''Create a new instance of word Application
    If (Len(txtbox.Text) = 0) Then

    Else

        Set objWord = CreateObject("word.Application")
        objWord.Visible = False
        Select Case objWord.version
            ''Office 2000, xp, 2k3
                Case "9.0", "10.0", "11.0"
                Set objDoc = objWord.Documents.Add(, , 1, True)
            ''Office 97
                Case Else
                Set objDoc = objWord.Documents.Add
        End Select

        objDoc.content = txtbox.Text
        objDoc.CheckSpelling
        objWord.Visible = False

        strResult = Left(objDoc.content, Len(objDoc.content) - 1)
        ''correct the carriage returns
        strResult = Replace(strResult, Chr(13), Chr(13) & Chr(10))


        ''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
        txtbox.Text = strResult


    End If

Done:
Exit Function

''in case user does not have word...
Err_Handler:
MsgBox Err.Description & Chr(13) & Chr(13) & "Please note you must have Microsoft Word installed to utilize the spell check feature.", vbCritical, "Error #: " & Err.Number
Resume Done

End Function




在此先感谢




Thanks In Advance

推荐答案

您使用的是XP(最佳或更旧)的硬件,没有超线程,我想...:confused:

我认为问题出在硬件上,操作系统正在暂停",因为它试图一次运行多个应用程序,我想如果您尝试在Windows XP中打开Excel面板,将会得到类似的结果. word文档(使用相同的API)...如果是这种情况,那么(在您的计算机上)您将无能为力...:doh:

有可能是图形/内存问题,但我想这更多是操作系统的限制..我将通过学习VB.Net来解决该问题.:laugh:
What hardware are you using XP(best or older), without hyper-threading I am guessing... :confused:

I believe the issue are having is a hardware issue, the OS is "pausing" as it is trying to run multiple apps at one time, I would guess you would get a similar result if you tried to open up an Excel panel inside of a word document (uses the same API''s)... if this is the case then there is nothing you can do about it (on your machine)... :doh:

there is the possibility that it is a graphics/memory issue, but i would guess it is more of an OS limitation.. I would solve the problem by learning VB.Net.... :laugh:


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

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