Solved

Wspell in a rich text box changes font

Posted on 2006-11-07
5
417 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 63

Accepted Solution

by:
Fernando Soto earned 500 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Regex validation 2 28
export data table to excel in vb.net 10 37
Obtain cell value using column ID in DataGrid using VB.NET 2 25
Help with adding DLL file in Windows project 20 40
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

830 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