web development India freelance website designer
Private Sub CheckSpelling()
Dim oSpellChecker As Object
Dim stText As String
Dim stNew_Text As String
Dim iPosition As Integer

On Error GoTo OpenError

'If you want to spell check a group of textboxes in a
'control array.. You can Spell check all of these with a
'do until loop.. There are multiple ways to do this but
'this is a simple one.

Set oSpellChecker = CreateObject("Word.Basic")

oSpellChecker.FileNew
oSpellChecker.Insert ActiveForm.rtfText.Text
oSpellChecker.ToolsSpelling
oSpellChecker.EditSelectAll
stText = oSpellChecker.Selection()
oSpellChecker.FileExit 2

If Right$(stText, 1) = vbCr Then _
stText = Left$(stText, Len(stText) - 1)
stNew_Text = ""
iPosition = InStr(stText, vbCr)
Do While iPosition > 0
stNew_Text = stNew_Text & Left$(stText, iPosition - 1) & vbCrLf
stText = Right$(stText, Len(stText) - iPosition)
iPosition = InStr(stText, vbCr)
Loop

stNew_Text = stNew_Text & stText
ActiveForm.rtfText.Text = stNew_Text
MsgBox "Spell Check Complete"
Exit Sub

OpenError:
MsgBox "Error" & Str$(Error.Number) & " opening Word." & vbCrLf & Error.Description
End Sub
Word Spelling 3

1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700

Freelance ASP PHP web development | Web developer India Web development India| Prayagasoft - web designer India, Ecommerce developer india, Ecommerce design