Click here to Skip to main content
12,883,272 members (35,994 online)
Click here to Skip to main content
Add your own
alternative version


76 bookmarked
Posted 2 Nov 2006

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#.

You may also be interested in...


Comments and Discussions

QuestionNew Release Pin
George H. Slaterpryce III5-Dec-11 21:18
memberGeorge H. Slaterpryce III5-Dec-11 21:18 
AnswerRe: New Release Pin
Chitation4-Jan-12 11:31
memberChitation4-Jan-12 11:31 
AnswerRe: New Release Pin
98z2831-Mar-12 11:35
member98z2831-Mar-12 11:35 
AnswerRe: New Release Pin
simon Barnby9-Aug-12 22:00
membersimon Barnby9-Aug-12 22:00 
AnswerRe: New Release Pin
dotnetme227-Sep-13 5:28
memberdotnetme227-Sep-13 5:28 
AnswerRe: New Release Pin
Member 1128637821-Dec-14 2:52
memberMember 1128637821-Dec-14 2:52 
AnswerRe: New Release Pin
Robert Gustafson3-Jul-15 11:36
memberRobert Gustafson3-Jul-15 11:36 
GeneralRe: New Release Pin
George H. Slaterpryce III6-Jul-15 9:17
memberGeorge H. Slaterpryce III6-Jul-15 9:17 
GeneralRe: New Release Pin
Robert Gustafson16-Jul-15 16:45
memberRobert Gustafson16-Jul-15 16:45 
GeneralRe: New Release Pin
George H. Slaterpryce III17-Jul-15 9:08
memberGeorge H. Slaterpryce III17-Jul-15 9:08 

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

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

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