使用vb6应用程序进行拼写检查. [英] Spell Check using vb6 application.
本文介绍了使用vb6应用程序进行拼写检查.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在创建一个程序来检查单词的拼写.它运作良好....
它检查拼写是否正确.这是我的代码:
I''m creating a program that check the spelling of the a word. It functioning well....
It check the spelling if the word is in the right spelling. Here is my code :
Option Explicit
Private Declare Function CoAllowSetForegroundWindow Lib "ole32.dll" (ByVal pUnk As Object, ByVal lpvReserved As Long) As Long
Private Sub Command1_Click()
Dim oWord As Object
Dim oTmpDoc As Object
Dim lOrigTop As Long
' Create a Word document object
Set oWord = CreateObject("Word.Application")
CoAllowSetForegroundWindow oWord, 0
Set oTmpDoc = oWord.Documents.Add
' Position Word off screen to avoid having document visible
lOrigTop = oWord.Top
oWord.WindowState = 0
oWord.Top = -3000
oWord.Visible = True
oWord.Activate
' Copy the contents of the text box to the clipboard
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Clipboard.Clear
Clipboard.SetText Text1.SelText
' Assign the text to the document and check spelling
With oTmpDoc
.Content.Paste
.Activate
'.CheckSpelling
' After the user has made changes, use the clipboard to
' transfer the contents back to the text box
.Content.Copy
Text1.Text = Clipboard.GetText(vbCFText)
' Close the document and exit Word
.Saved = True
.Close
End With
Set oTmpDoc = Nothing
oWord.Visible = False
oWord.Top = lOrigTop
oWord.Quit
Set oWord = Nothing
End Sub
我的问题是,如果单词拼写错误,将不再打开/弹出单词应用程序的对话框,我只想返回一些确定单词拼写错误的值,就不会再出现对话框.
有人知道吗???请我帮忙....任何想法表示感谢...谢谢.
My problem is, if the word is wrong spelling the dialog of the word application will not any more open/pop up, I want to just return some value that will determine if the word is wrong spelling, no dialog box will appear any more.
Anybody know about this???? Please I need your help....any idea appreciated...Thanks.
推荐答案
查看 ^ ].
这篇关于使用vb6应用程序进行拼写检查.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文