Dim speller As Object
Dim txt As String
Dim new_txt As String
Dim pos As Integer
speller = CreateObject("Word.Basic")
speller.FileNew()
speller.Insert(RichTextBox1.Text)
speller.ToolsSpelling()
speller.EditSelectAll()
txt = speller.Selection()
If RSet(txt, 1) = vbCr Then _
txt = LSet(txt, Len(txt) - 1)
new_txt = ""
pos = InStr(txt, vbCr)
Do While pos > 0
new_txt = new_txt & LSet(txt, pos - 1) & vbCrLf
txt = RSet(txt, Len(txt) - pos)
pos = InStr(txt, vbCr)
Loop
new_txt = new_txt & txt
speller.FileExit(2)
RichTextBox1.Text = new_txt
0 comentarios:
Publicar un comentario