Link to home
Start Free TrialLog in
Avatar of hlominac
hlominac

asked on

Wspell in a rich text box changes font

I am using WSpell ActiveX Spelling Checker by Wintertree to check spelling in a rich text box.  The spelling checker works OK, but when I save it the font changss, losing my multiple fonts, bold, centering, etc.  RTB is my rich text box.  Below is my subroutine:

   Private Sub Spell()
      Dim Temp As String = RTB.Text
      Dim Hold As String
      Dim Res As Integer
      AxWSpell.Text = Temp
      AxWSpell.ShowContext = True
      Res = AxWSpell.Start()
      If Res <= 0 Then
         Hold = AxWSpell.Text 'Contains corrections
         RTB.Text = Hold 'This chnages fonts, etc. occurs here
      End If
   End Sub 'Spell

How can I preserve my original formatting?
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hlominac
hlominac

ASKER

That worked, but the spell checker had to check all the markup language.  This is what I used.
   Private Sub Spell()
      Dim Temp As String = RTB.Rtf
      Dim Hold As String
      Dim Res As Integer
      AxWSpell.Text = Temp
      AxWSpell.ShowContext = True
      Res = AxWSpell.Start()
      If Res <= 0 Then
         Hold = AxWSpell.Text
         RTB.Rtf = Hold
      End If
   End Sub 'Spell
Is there a way to get around checking the markup language for spelling other than placing the words in the dictionary?
Hi hlominac;

I have not used Wspell before. I went to there web site but they do not have any documentation that I can look at to see how they check and replace words to a Rich text control. Does Wspell come with any documentation? If so does it state how to spell check a Rich text control with out losing the formatting. There web site states that they can spell check a Rich text control.

Fernando
They can skip the markup language in HTML, but that is all.

"WSpell expects text to be in a simple format: words, numbers, and punctuation surrounded by white space. If you want to check text in more complex formats, you may have to take over responsibility for extracting plain text from the document and passing only the plain text to WSpell for checking."

Thanks you for your quick response and suggestions.  At least you got me past the basic problem.
Sorry there was not a better solution to your question.

You have a great day. ;=)