Spelling Grammar Check.
Spelling Grammar Check.
Rate Spelling Grammar Check.
(1(1 Vote))
1. From the Project menu, click References.
2. To include the Microsoft Word 8.0 Object Library in your project, make sure
that there's an "x" in the check box next to its listing, and then click OK.
3. Double-click the Check Spelling button, and then type the following program
code in the Code window:
Dim X As Object 'create Word object
Set X = CreateObject("Word.Application")
X.Visible = False 'hide Word
X.Documents.Add 'open a new document
X.Selection.Text = Text5.Text 'copy text box to document
X.ActiveDocument.CheckGrammar 'run spell/grammar checker
Text5.Text = X.Selection.Text 'copy corrected text to VB
X.ActiveDocument.Close SaveChanges:= wdDoNotSaveChanges
X.Application.Quit 'quit Word
Set X = Nothing 'release object variable
Spelling Grammar Check. Comments
No comments yet — be the first to post one!
Post a Comment