A Better SpellChecker
This is basically an enhanced version of the SpellCheck function that I found in MSDN from Microsoft. They left out a couple things.
AI
Riepilogo AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Codice sorgente
Public Function SpellCheck(strText As String, Optional blnSupressMsg As Boolean = False) As String
'This function opens the MS Word Object and uses its spell checker
'passing back the corrected string
On Error Resume Next
Dim oWDBasic As Object
Dim sTmpString As String
If strText = "" Then
If blnSupressMsg = False Then
MsgBox "Nothing to spell check.", vbInformation, App.ProductName
End If
Exit Function
End If
Screen.MousePointer = vbHourglass
Set oWDBasic = CreateObject("Word.Basic")
With oWDBasic
.FileNew
.Insert strText
.ToolsSpelling oWDBasic.EditSelectAll
.SetDocumentVar "MyVar", oWDBasic.Selection
End With
sTmpString = oWDBasic.GetDocumentVar("MyVar")
sTmpString = Left(sTmpString, Len(sTmpString) - 1)
If sTmpString = "" Then
SpellCheck = strText
Else
SpellCheck = sTmpString
End If
oWDBasic.FileCloseAll 2
oWDBasic.AppClose
Set oWDBasic = Nothing
Screen.MousePointer = vbNormal
If blnSupressMsg = False Then
MsgBox "Spell check is completed.", vbInformation, App.ProductName
End If
End Function
<button onclick="window.opener=null;window.close()">CLOSE THE WINDOW</button>
Commenti originali (3)
Recuperato da Wayback Machine