Solved

Wspell in a rich text box changes font

Posted on 2006-11-07
5
413 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
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 62

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 62

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SLMGR Switches Are Not Working On KMS Host 3 92
VB.Net How to Exit Sub - Exit Form??? 5 57
Convert an ASPX page into PDF 7 32
VB.net Open Folder in Windows Explorer 3 29
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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…

770 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