3 replies
by andrew
If you'd like to go the ActiveX route, here's some code for the OCX:
Option Explicit
Private mText As String
Private mCorrectedText As String
Public Property Let TextToCheck(sText As String)
mText = sText
End Property
Public Property Get CorrectedText() As String
CorrectedText = mCorrectedText
End Property
Public Sub SpellCheck()
Dim oDocument As Word.Document
Set oDocument = New Word.Document
oDocument.Content.InsertAfter mText
oDocument.CheckSpelling
mCorrectedText = oDocument.Content
Set oDocument = Nothing
End Sub
(You'll need to set a reference to the Microsoft Word 9.0 Object Library)
To use the OCX, instantiate it on your page (use the OBJECT tag), set the TextToCheck property, call the SpellCheck() method, then read the CorrectedText property.
If you prefer, you can recode it to do everything with a single function call.
Hope this helps.
by cholderby
by cholderby
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending