使用vb6应用程序进行拼写检查.

编程入门 行业动态 更新时间:2024-10-25 14:27:29
本文介绍了使用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.

推荐答案

查看使用Microsoft Office Word进行拼写检查并为错误的单词加下划线 [ ^ ].

更多推荐

使用vb6应用程序进行拼写检查.

本文发布于:2023-05-25 11:03:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/297760.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!