Solved

Wspell in a rich text box changes font

Posted on 2006-11-07
5
401 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
  • 3
  • 2
5 Comments
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
Comment Utility
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
Comment Utility
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 62

Expert Comment

by:Fernando Soto
Comment Utility
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
Comment Utility
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 62

Expert Comment

by:Fernando Soto
Comment Utility
Sorry there was not a better solution to your question.

You have a great day. ;=)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
This video discusses moving either the default database or any database to a new volume.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now