?
Solved

Wspell in a rich text box changes font

Posted on 2006-11-07
5
Medium Priority
?
421 Views
Last Modified: 2013-12-03
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?
0
Comment
Question by:hlominac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 17890656
Hi hlominac;

RTB.Text returns the text in a RichTextBox. This text has no formatting in it.
RTB.Rtf returns the text with rich formatting included. Use RTB.Rtf to include rich text formatting.

Hope that helps.

Fernando
0
 

Author Comment

by:hlominac
ID: 17891766
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?
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 17891975
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
0
 

Author Comment

by:hlominac
ID: 17892989
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.
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 17893047
Sorry there was not a better solution to your question.

You have a great day. ;=)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question