Click here to Skip to main content
11,410,750 members (64,360 online)
Click here to Skip to main content

Using a VB.NET 2005 Class to Convert RichText to HTML

, 2 Nov 2006 CPOL
Rate this:
Please Sign up or sign in to vote.
A quick way to convert RichText to HTML.

A window showing a Rich Editor and the resutling HTML code


This code was written to solve the problem of having RichText data needing to be displayed in HTML, both in HTML reports and in ASP.NET web pages.

Using the code

Use of the code is exceptionally simple. Simply create a new instance of the class and then use the properties to first pass in the RichText to parse and then use the html property to get the resulting HTML. (The code file for the class is attached to this article).

''Assume you have a RichTextBox on your 
''form named rtbFoo and a button named btnBar

  Private Sub btnBar_Click(ByVal sender as object, _
          e as System.EventArgs) Handles btnBar.Click
    dim r2h as new RTFtoHTML
    r2h.rtf = rtbFoo.rtf
  End Sub


  • Initial release - 11/02/2006.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

George H. Slaterpryce III
United States United States
Developing software since 1995, starting out with Borland Turbo C++ 3 & Motorolla Assembly.
Eventually learning several different languages such as
Pascal/Delphi,Basic, Visual Basic,FoxPro, ASP, PHP, and Perl.

Currently using the .net framework for most development task.

Hobbies include underwater robotics, and electronics.

George's current language of choice is C#.

Comments and Discussions

Suggestionjust a superscript update PinmemberMember 231670319-Dec-14 23:19 
GeneralMy vote of 3 Pinmemberhepter4-Jan-14 0:32 
QuestionAre you kidding me!? PinmemberFuck you assholes30-Jul-12 6:09 
AnswerRe: Are you kidding me!? PinmemberGeorge H. Slaterpryce III30-Jul-12 11:07 
Questionc# PinmemberJheiron29-Jun-12 8:51 
AnswerRe: c# PinmemberGeorge H. Slaterpryce III30-Jul-12 11:08 
Questionhow can I use with Strike tag? Pinmemberkals8420-Dec-11 2:53 
QuestionNew Release PinmemberGeorge H. Slaterpryce III5-Dec-11 22:18 
AnswerRe: New Release PinmemberChitation4-Jan-12 12:31 
AnswerRe: New Release Pinmember98z2831-Mar-12 12:35 
AnswerRe: New Release Pinmembersimon Barnby9-Aug-12 23:00 
AnswerRe: New Release Pinmemberdotnetme227-Sep-13 6:28 
AnswerRe: New Release PinmemberMember 1128637821-Dec-14 3:52 
Answervery nice code & good readers hint. Pinmembernasimb16-Nov-11 4:00 
Questiondisplay html format in Pinmemberepit2429-Sep-11 18:04 
QuestionFix for .NET4 and VS2010 PinmemberJohnnyasdf11-Sep-11 13:36 
AnswerRe: Fix for .NET4 and VS2010 PinmemberMember 945127426-Apr-14 3:29 
BugA little bug? Pinmember98z2813-Aug-11 9:38 
GeneralRe: A little bug? PinmemberGeorge H. Slaterpryce III15-Aug-11 17:31 
GeneralRe: A little bug? Pinmember98z2817-Aug-11 10:18 
GeneralRe: A little bug? PinmemberJohnnyasdf10-Sep-11 14:54 
Very nice code. I'm kinda giving a bump to the op's last post. Do you have any kind of link to a beta of your new release? I'm really liking the class and want to use it for a lot of applications. The image code would be nice, but it's not necessary for my needs, so if you have any kind of update, that would be awesome. Very nice contribution btw, I'm personally very impressed with your work on this. Thank you again for your hard work and your contribution to the community. I know how hard it is to contribute opensource and then have to manage it, so, I wanted to thank you again for that as well. Any update is appreciated, I'm sure everyone here is looking forward to it, thanks,
QuestionConversion of text in textbox to HTML file PinmemberAdarshPatil25-Nov-10 20:35 
GeneralUnderline Pinmemberkheonline6-Oct-10 5:30 
QuestionCombined with RTBExVB Pinmemberbigbro_19858-Aug-10 21:29 
AnswerRe: Combined with RTBExVB PinmemberGeorge H. Slaterpryce III3-Sep-10 10:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150414.5 | Last Updated 2 Nov 2006
Article Copyright 2006 by George H. Slaterpryce III
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid